SOLVED

Adding Google Analytics Code to Existing Landing Pages Created with Templates

Go to solution
Lindseyirvine
Level 1

Adding Google Analytics Code to Existing Landing Pages Created with Templates

Hi,

 

I am trying to add Google Ads Conversion Code to a Thank You Page that was created with a template. I originally tried doing this through editing meta tags and sticking the code into the custom head html, but that did not work. I am now thinking I need to hard code this. How do you access the HTML of an existing landing page built with a template.

 

Is there an easier way to do this?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Christiane_Rode
Level 7 - Community Advisor + Adobe Champion

Re: Adding Google Analytics Code to Existing Landing Pages Created with Templates

We recently tackled this for our landing pages as well. 

 

The template for your landing page template should be stored in Design Studio in the landing page templates folder and you can update the code there.

 

I usually will clone the original template to have fallback code in case something goes terribly wrong, but then I'll update the original template with my new code. This way you don't have to re-create all your LPs, you just have to re-approve them to get the GA loaded.

View solution in original post

6 REPLIES 6
Christiane_Rode
Level 7 - Community Advisor + Adobe Champion

Re: Adding Google Analytics Code to Existing Landing Pages Created with Templates

We recently tackled this for our landing pages as well. 

 

The template for your landing page template should be stored in Design Studio in the landing page templates folder and you can update the code there.

 

I usually will clone the original template to have fallback code in case something goes terribly wrong, but then I'll update the original template with my new code. This way you don't have to re-create all your LPs, you just have to re-approve them to get the GA loaded.

SanfordWhiteman
Level 10 - Community Moderator

Re: Adding Google Analytics Code to Existing Landing Pages Created with Templates

While @Christiane_Rode‘s suggestion is by far more scalable, there’s no technical reason you can’t use Custom Head HTML for this. Please supply the exact code you tried to plug into the Custom Head HTML box.

Lindseyirvine
Level 1

Re: Adding Google Analytics Code to Existing Landing Pages Created with Templates

@SanfordWhiteman 

 

Here is the code:

 

  1. <!-- Event snippet for Submit lead form conversion page --> <script>
              gtag('event', 'conversion', {'send_to': 'AW-657905170/4h5tCO6l7dUBEJKs27kC'});
              </script>
    
SanfordWhiteman
Level 10 - Community Moderator

Re: Adding Google Analytics Code to Existing Landing Pages Created with Templates

That would never run, on a template or here, because you forgot to include the Gtag library itself (gtag.js).
Lindseyirvine
Level 1

Re: Adding Google Analytics Code to Existing Landing Pages Created with Templates

Thanks!

 

So gtag first then event snippet?

SanfordWhiteman
Level 10 - Community Moderator

Re: Adding Google Analytics Code to Existing Landing Pages Created with Templates

Yes.