Hi Sanford and community,
I'm implementing GTM tracking for our Marketo landing pages and need guidance on container strategy for our multi-region setup.
Our Current Setup:
My Questions:
form.onSuccess(function handleSuccess (values, followUpUrl) { window.dataLayer.push({ "event": "mkto.form.success", "mkto.form.values": values, "mkto.form.followUpUrl": followUpUrl, "eventCallback": function () { document.location.href = followUpUrl; }, "eventTimeout": 3000 }); return false; });
Any guidance would be greatly appreciated!
Thanks, L
Solved! Go to Solution.
- Do I need a separate GTM container specifically for go.legalvision.com.au? Or can I use one of our existing corporate domain containers?
- If I need a dedicated container for the Marketo subdomain, will one container work across all three regional subdomains (go.legalvision.com.au/co.nz/co.uk) given the domain alias setup and non-partitioned database?
There’s no one-size answer. You can, in the technical sense, use an existing container. But I usually recommend creating a new container for the Marketo LPs, covering the primary LP + all domain aliases. 2 main reasons:
That said, sharing a container can make sense. Like to make sure a given tag only fires once to the same backend: GTM won’t actually prevent 2 tags that do the same thing under the hood, but at least you’ll see them all in one place in the UI, unlike with different containers. Would still avoid it at almost any cost.
3. Form tracking: I've read your posts about needing eventCallback for proper form tracking. For our use case (form submissions that redirect to TY pages), is this the correct implementation in the form listener?javascriptform.onSuccess(function handleSuccess (values, followUpUrl) { window.dataLayer.push({ "event": "mkto.form.success", "mkto.form.values": values, "mkto.form.followUpUrl": followUpUrl, "eventCallback": function () { document.location.href = followUpUrl; }, "eventTimeout": 3000 }); return false; });
Yep, that’ll be fine.
Note you don’t need a check to see if dataLayer exists and its callback code is functional, e.g. that GTM wasn’t blocked by an ad blocker. A casual observer might think you do, but you don’t! I’ll write a little blog post about this when I get a chance.
3. Form tracking: I've read your posts about needing eventCallback for proper form tracking. For our use case (form submissions that redirect to TY pages), is this the correct implementation in the form listener?javascriptform.onSuccess(function handleSuccess (values, followUpUrl) { window.dataLayer.push({ "event": "mkto.form.success", "mkto.form.values": values, "mkto.form.followUpUrl": followUpUrl, "eventCallback": function () { document.location.href = followUpUrl; }, "eventTimeout": 3000 }); return false; });
Yep, that’ll be fine.
Note you don’t need a check to see if dataLayer exists and its callback code is functional, e.g. that GTM wasn’t blocked by an ad blocker. A casual observer might think you do, but you don’t! I’ll write a little blog post about this when I get a chance.
Thank you so much! This is super helpful - looking forward to reading your post! 😊
- Do I need a separate GTM container specifically for go.legalvision.com.au? Or can I use one of our existing corporate domain containers?
- If I need a dedicated container for the Marketo subdomain, will one container work across all three regional subdomains (go.legalvision.com.au/co.nz/co.uk) given the domain alias setup and non-partitioned database?
There’s no one-size answer. You can, in the technical sense, use an existing container. But I usually recommend creating a new container for the Marketo LPs, covering the primary LP + all domain aliases. 2 main reasons:
That said, sharing a container can make sense. Like to make sure a given tag only fires once to the same backend: GTM won’t actually prevent 2 tags that do the same thing under the hood, but at least you’ll see them all in one place in the UI, unlike with different containers. Would still avoid it at almost any cost.