SOLVED

Re: Two GTA in one page

Go to solution
Harish_Gupta6
Level 8

Two GTA in one page

Hi,

Is it fine, if I will add two google tag manager script in head tag of one landing page?

Also, currently, one GTM code has been added in templates and I want to replace it in only one landing page(Not from template). Can you suggest me how to implement this?

Thanks

Harish Gupta
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Harish_Gupta6
Level 8

Re: Two GTA in one page

Hi Sanford,

Thanks for help. Can you suggest the best place on landing page to place the GA code if I will use the mktoBoolean variable?

Thanks

Harish Gupta

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Two GTA in one page

Is it fine, if I will add two google tag manager script in head tag of one landing page?

It's "fine" but not recommended b/c it can cause immense confusion.  If you control both GTMs you should consolidate into one.

Also, currently, one GTM code has been added in templates and I want to replace it in only one landing page(Not from template). Can you suggest me how to implement this?

The only way to "override" an included script from the template is to make the inclusion itself always based on a variable. For example, create a mktoBoolean variable, defaulting to true, and only load the GTM if the variable is still true at the LP level.

Harish_Gupta6
Level 8

Re: Two GTA in one page

Hi Sanford,

Thanks for help. Can you suggest the best place on landing page to place the GA code if I will use the mktoBoolean variable?

Thanks

Harish Gupta
SanfordWhiteman
Level 10 - Community Moderator

Re: Two GTA in one page

Well, you would typically add it to the <HEAD> of the template.  With a boolean called enableGTM1, you would wrap it like:

<script>${enableGTM1} && (function(w,d,s,l,i){...
Harish_Gupta6
Level 8

Re: Two GTA in one page

Hi Sanford,

Thanks for help. Can you suggest the best place on landing page to place the GA code if I will use the mktoBoolean variable?

Thanks

Harish Gupta