Skip to main content
Harish_Gupta6
Level 6
Oct 19, 2016 1:50 PM UTC
Solved

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Harish_Gupta6
Harish_Gupta6Accepted solution
Level 6
Oct 20, 2016 3:26 PM UTC

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

4 replies

SanfordWhiteman
User Group Leader
User Group Leader
Oct 19, 2016 9:07 PM UTC

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.

Translate
Harish_Gupta6
Level 6
Oct 20, 2016 3:27 PM UTC

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

Translate
Harish Gupta
SanfordWhiteman
User Group Leader
User Group Leader
Oct 20, 2016 8:59 PM UTC

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){...
Translate
Harish_Gupta6
Harish_Gupta6AuthorAccepted solution
Level 6
Oct 20, 2016 3:26 PM UTC

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

Translate
Harish Gupta