Skip to main content
Level 2
Oct 25, 2021 1:48 PM UTC
Solved

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ChristianeRo1
ChristianeRo1Accepted solution
Adobe Champion and Community Advisor
Oct 25, 2021 2:09 PM UTC

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.

6 replies

ChristianeRo1
Adobe Champion and Community Advisor
ChristianeRo1Adobe Champion and Community AdvisorAccepted solution
Adobe Champion and Community Advisor
Oct 25, 2021 2:09 PM UTC

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.

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Oct 26, 2021 12:06 AM UTC

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.

Translate
Level 2
Oct 26, 2021 5:03 PM UTC

@sanfordwhiteman 

 

Here is the code:

 

  1. <!-- Event snippet for Submit lead form conversion page --> <script>
              gtag('event', 'conversion', {'send_to': 'AW-657905170/4h5tCO6l7dUBEJKs27kC'});
              </script>
    
Translate
SanfordWhiteman
User Group Leader
User Group Leader
Oct 26, 2021 5:35 PM UTC
That would never run, on a template or here, because you forgot to include the Gtag library itself (gtag.js).
Translate