Adding Google Analytics Code to Existing Landing Pages Created with Templates | Community
Skip to main content
New Participant
October 25, 2021
Solved

Adding Google Analytics Code to Existing Landing Pages Created with Templates

  • October 25, 2021
  • 2 replies
  • 3640 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ChristianeRo1

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.

2 replies

SanfordWhiteman
New Participant
October 26, 2021

While @christianero1‘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.

New Participant
October 26, 2021

@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
New Participant
October 26, 2021
That would never run, on a template or here, because you forgot to include the Gtag library itself (gtag.js).
ChristianeRo1Accepted solution
Community Manager
October 25, 2021

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.