SOLVED

Re: GTM Container Setup for Marketo Landing Pages - Subdomain Strategy Clarification

Go to solution
lillyfalcon
Level 3

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:

  • Marketo subdomain
  • 2 domain aliases
  • We promote pages using the region-specific subdomain

My Questions:

  1. Do I need a separate GTM container specifically for our Marketo subdomain? Or can I use one of our existing corporate domain containers?
  2. If I need a dedicated container for the Marketo subdomain, will one container work across all three regional subdomains given the domain alias setup and non-partitioned database?
  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?
 
javascript
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

Lilly Falcon
2 ACCEPTED SOLUTIONS
SanfordWhiteman
Level 10 - Community Moderator

  1. Do I need a separate GTM container specifically for go.legalvision.com.au? Or can I use one of our existing corporate domain containers?
  2. 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:

 

  1. Ease of managing things: Seeing only tags you understand and own in the GTM UI makes troubleshooting easier.
  2. Difficulty of breaking things: it frankly terrifies me when an admin can deploy tags that affect totally different sites (tags that aren’t expected to be global). Companies rarely use strict procedures, e.g. use of variables, to avoid that. It just seems like a postmortem waiting to happen.

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.

View solution in original post

SanfordWhiteman
Level 10 - Community Moderator

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?
 
javascript
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;
});

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.

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

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?
 
javascript
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;
});

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.

lillyfalcon
Level 3

Thank you so much! This is super helpful - looking forward to reading your post! 😊

Lilly Falcon
SanfordWhiteman
Level 10 - Community Moderator

  1. Do I need a separate GTM container specifically for go.legalvision.com.au? Or can I use one of our existing corporate domain containers?
  2. 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:

 

  1. Ease of managing things: Seeing only tags you understand and own in the GTM UI makes troubleshooting easier.
  2. Difficulty of breaking things: it frankly terrifies me when an admin can deploy tags that affect totally different sites (tags that aren’t expected to be global). Companies rarely use strict procedures, e.g. use of variables, to avoid that. It just seems like a postmortem waiting to happen.

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.