Skip to main content

Add Google Tag Manager to a site

Install Google Tag Manager on a Kajabi site with Header Page Scripts, add it to Encore or Premier pages, and see where GTM tags don't fire.

Google Tag Manager (GTM) is a free Google tool for adding and managing tracking tags, like Google Analytics 4, Google Ads, and other marketing pixels, in one place instead of editing site code each time. Use it when you need tracking beyond what Kajabi Analytics reports.

Install Google Tag Manager

To install GTM on a Kajabi site, you paste two code snippets from a GTM container into the site. Before you start, create a Google Tag Manager account and a web container for the site.

If you only need Google Analytics, you don't need GTM. Kajabi has a built-in integration: learn how to connect Google Analytics with Kajabi.

Warning: Custom code can expose a site to vulnerabilities and malware. Only paste code you got directly from your own Google Tag Manager container. To check other custom code, scan it with a tool like VirusTotal or Snyk, and follow these best practices for custom code.

Google Tag Manager code snippets

Every Google Tag Manager container comes with two code snippets that are unique to it. Copy both from the GTM container. The example snippets in this article's screenshots won't work on a site.

  • Head snippet: a script that loads GTM and fires the tags. It starts with <!-- Google Tag Manager -->.

  • Body snippet: a fallback for visitors whose browsers have JavaScript turned off. It starts with <!-- Google Tag Manager (noscript) -->.

Header Page Scripts adds the head snippet to every site page at once. The body snippet goes on individual pages, and how you add it depends on whether the page uses the Encore template or the legacy Premier template.

Add the GTM head snippet to every site page

To add Google Tag Manager to every page of a Kajabi site, paste the GTM head snippet into the Header Page Scripts field. Kajabi places Header Page Scripts in the <head> section of every site page.
​

Google Tag Manager
  1. In Google Tag Manager, open the site's container and copy the head snippet.

  2. From the Dashboard, click Settings, then under Site settings, click Site details.

  3. Scroll to the Page scripts section.

  4. Paste the GTM head snippet into the Header Page Scripts field. If the field already holds other scripts, paste the snippet on a new line below them instead of replacing them:
    ​

    Page scripts field

  5. Click Save. GTM loads on every site page, except the pages listed in the “Pages where Google Tag Manager doesn't run” section of this article.

To confirm Google Tag Manager is working:

  1. Open the Workspace tab in GTM and click Preview.

  2. Enter the site's URL, and click Connect. The site opens connected to Tag Assistant, which shows which tags fired and in which order.
    ​Learn more about previewing a GTM container.

Add the GTM body snippet to an Encore page

To add the Google Tag Manager body snippet to a page built with the Encore template, add a Custom Code section to the page.

Example Google Tag Manager body snippet, a noscript block that starts with the Google Tag Manager (noscript) comment
  1. In Google Tag Manager, open the site's container and copy the body snippet.

  2. From the Dashboard, click Website, then Website Pages or Landing Pages.

  3. Click the Title of the page to open it in the editor.

  4. Click Add section in the left sidebar.

  5. Scroll to the end of the list, select Custom Code, then click Add.

  6. In the new section, click the Custom Code block in the left sidebar to open it.

  7. Paste the GTM body snippet into the Code field:
    ​

  8. Click Save. The body snippet is added to that page.

Add Google Tag Manager to a Premier page

For pages built with the legacy Premier template, you add the Google Tag Manager snippets in the Code Editor. Where they go depends on whether the page is a Landing Page or a Website Page. Learn more about the Premier template.

Note: The Code Editor is available on the Pro plan. Compare Kajabi's pricing plans.

Warning: Header Page Scripts also load on Premier pages. If you already added the GTM head snippet to Header Page Scripts, don't paste it again in the Code Editor. Loading the same GTM container twice on a page can fire each tag twice.

Add the GTM snippets to a Premier Landing Page

To add Google Tag Manager to a Landing Page built with Premier, paste the snippets into the Landing Page's index.liquid file.

  1. In Google Tag Manager, open the site's container to copy each snippet as you need it.

  2. From the Dashboard, click Website, then Landing Pages.

  3. Open the Landing Page's more options (...) menu and select Modify code:
    ​


    ​

  4. Open the Templates folder and select the index.liquid file:
    ​

    GTM Premier Landing Page

  5. Paste the GTM head snippet on the line below the opening <head> tag.

  6. Paste the GTM body snippet on the line below the opening <body> tag.

  7. Click Save. The GTM snippets are added to that Landing Page.

Add the GTM body snippet to a Premier site

To add the Google Tag Manager body snippet to Website Pages built with Premier, paste it into the site theme's theme.liquid layout file. On a Premier site, the <body> tag lives in this shared layout, not in each page's template, so the snippet applies to every site page that uses the layout. Header Page Scripts already cover the head snippet on these pages.

  1. In Google Tag Manager, open the site's container and copy the body snippet.

  2. From the Dashboard, click Website, then Website Pages.

  3. Open any page's more options (...) menu and select Modify code:
    ​

  4. Open the Layouts folder and select the theme.liquid file:
    ​

    GTM Premier site

  5. Paste the GTM body snippet on the line below the opening <body> tag.

  6. Click Save. The body snippet is added to every site page that uses the theme layout.

Pages where Google Tag Manager doesn't run

Google Tag Manager runs through Header Page Scripts, and Kajabi doesn't load Header Page Scripts on some pages. GTM tags and triggers don't fire on these pages:

  • Offer checkout pages

  • Upsell pages

  • Account Creation page

To track purchases reliably across every checkout path, use Kajabi's built-in integrations. They add their own purchase tracking to checkout pages and the Account Creation page, separately from Header Page Scripts:

FAQs

Do I need to add the GTM body snippet?

The GTM body snippet is a <noscript> fallback, so browsers only use it when JavaScript is turned off. The head snippet in Header Page Scripts handles tracking for everyone else. Google's install instructions include both snippets, so we recommend adding the body snippet to the pages that matter most for tracking, like Sales and opt-in pages.

Can I use Google Tag Manager and the built-in Google Analytics integration together?

Yes, you can use Google Tag Manager and Kajabi's Google Analytics integration on the same site, but don't send one Google Analytics property through both. If a Google Analytics tag in GTM and the built-in integration use the same Measurement ID, each page view can be recorded twice. GTM's Preview mode flags duplicated tags. We recommend using the built-in integration for that property, since it also tracks purchases on checkout pages, where GTM doesn't run.

Did this answer your question?