This article provides step-by-step instructions on how to install Google Tag Manager container code in Kartra pages.
Important: The HEAD section in Kartra pages accepts JavaScript only. HTML must be removed from any tracking code entered in the HEAD section.
Get the Google Tag Manager code
Follow the instructions from Google Support documentation to create a Tag Manager account and a container for your Kartra assets.
Read: Set up and install Tag Manager (Google Support)
Choose the container type Web and AMP
When the setup is complete, Tag Manager will provide you with two code snippets. (Example below)
Install the tracking code in a Kartra page
To install the Google Tag Manager, open a page in your Kartra account:
Click Settings in the left side menu
Click Tracking Codes
Go back to Tag Manager and copy the first snippet for the section
In Kartra, paste the snippet in the Embed tracking code into the field
IMPORTANT: This field does not accept HTML code. To use the GTM code snippet in a Kartra page, you must remove the HTML tags AND the HTML comments at the beginning and end of the code. Replace the HTML comments with JavaScript comments.
JavaScript comments:
/* Google Tag Manager */
/* End Google Tag Manager */
Your modified code should look something like this:
Go back to Tag Manager and copy the second snippet for the section
In Kartra, paste the snippet in the Embed tracking code into the field
Click Apply
Click Actions > Publish live in the top right menu to publish the page so Google can detect the new code
Repeat this process for all pages you want to track with the Google Tag Manager.
Resources
For more information on how to use the Tag Manager or debug your setup, consult Google Support resources.
Global site update
If the page is assigned to a Site, export Tracking Codes to update all site pages in a global action:
In the page builder, click Sites
In Export to Site, toggle Tracking Codes ON
Select all or specific pages from the Export to other pages dropdown
Click Apply
Click Proceed to acknowledge the overwrite warning
The export will begin immediately. Depending on the number of pages assigned the site, it may take some time to complete.






