Title: samfletch's Replies | WordPress.org

---

# samfletch

  [  ](https://wordpress.org/support/users/samfletch/)

 *   [Profile](https://wordpress.org/support/users/samfletch/)
 *   [Topics Started](https://wordpress.org/support/users/samfletch/topics/)
 *   [Replies Created](https://wordpress.org/support/users/samfletch/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/samfletch/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/samfletch/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/samfletch/engagements/)
 *   [Favorites](https://wordpress.org/support/users/samfletch/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[MC4WP: Mailchimp for WordPress] Mailchimp Top Bar Newsletter Sign up](https://wordpress.org/support/topic/mailchimp-top-bar-newsletter-sign-up/)
 *  Thread Starter [samfletch](https://wordpress.org/support/users/samfletch/)
 * (@samfletch)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/mailchimp-top-bar-newsletter-sign-up/#post-14760801)
 * Hi Lap ,
 * Thanks for the quick reply!
 * JS events looks like a good solution. Could you confirm that the following code
   taken from [here](https://www.mc4wp.com/kb/form-events-google-analytics-tracking/)
   would work with the Mailchimp top bar?
 * _`<script type=”text/javascript”>
    mc4wp.forms.on(‘subscribed’, function(form){//
   GTM Data Layer push window.dataLayer = window.dataLayer || []; window.dataLayer.
   push({ ‘event’ : ‘Sign-up’, ‘name’ : form.name + ‘ ID: ‘ + form.id }); }); </
   script>`
 * If so would this script be added into the header of the site?
 * Many thanks

Viewing 1 replies (of 1 total)