Where should the GTM snippet go?
-
Hello,
I would like to trigger a tag when a pop-up form is submitted.
Here are the steps until far:
1) Create subscriber pop-up form on Mailchimp
2) View code > Copy code in Mailchimp
3) Created a new form with your plugin > pasted the script in the form.I then pasted the event script from your website under the first script:
<script type=”text/javascript”>
mc4wp.forms.on(‘submitted’, function(form) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ ‘event’ : ‘Sign-up’, ‘name’ : form.name + ‘ ID: ‘ + form.id });
});
</script>4) Created a GTM tag which is trigged by the custom event name ‘Sign-up’
5) Pasted the shortcode in a box with Boxzilla
6) Pasted the same shortcode in a post via the text editor
7) Submitted the form on the post page. Nothing happens, no event is sent.I have tried pasting the tracking code from your website in Mailchimp’s form, in the post html via the text editor under the form shortcode, and also under the shortcode in the box. Nothing worked.
Any idea why I don’t see an event sent in the Google Tag Manager preview pane?
The page I need help with: [log in to see the link]
- The topic ‘Where should the GTM snippet go?’ is closed to new replies.