---
title: "Example 2: Google Tag Manager (tracking)"
description: When you implement A/B testing (or other Smart Content) you will want to track the results.
---

[Skip to content](https://support.sitemanager.io/en/logic/ab-examples/example-2-google-tag-manager-tracking-for-ab-testing#main-content)

[![SiteManager Platform](https://support.sitemanager.io/hs-fs/hubfs/SM_Platform-logo.png?width=164&height=40&name=SM_Platform-logo.png)](https://support.sitemanager.io/en?hsLang=en)

Open main navigation

Close main navigation

- [Go to sitemanager.io](https://www.sitemanager.io/)

[Go to sitemanager.io](https://www.sitemanager.io/)

 How can we help?

- There are no suggestions because the search field is empty.

1. [Knowledge Base](https://support.sitemanager.io/en?hsLang=en)
2. [Logic (Smart Content)](https://support.sitemanager.io/en/logic-smart-content?hsLang=en)
3. [AB testing](https://support.sitemanager.io/en/logic-smart-content?hsLang=en#ab-testing)

# Example 2: Google Tag Manager (tracking)

## When you implement A/B testing (or other Smart Content) you will want to track the results.

Our Smart Content module has recently been renamed to Logic. All documentation will be updated with the new name in the future.

 

In this example, we are going to add Google Tag Manager to our website to track the A/B results of the previous example: [https://support.sitemanager.io/ab-testing-cta-banner](https://support.sitemanager.io/ab-testing-cta-banner?hsLang=en)

However, you can use any website tracking tool you like and implement it.

### 1. Add Google Tag Manager

If you haven't already added Google Tag Manager to your SiteManager project, you can check out our article on [How to add Google Tag Manager](https://support.sitemanager.io/en/how-to-add-google-tag-manager?hsLang=en).

### 2. Tag Manager selector ID

Using Tag Manager, you can create triggers when for example a button is clicked. To make it simple, you can add a unique ID to the button of your CTA.

![codetagid](https://support.sitemanager.io/hs-fs/hubfs/codetagid.jpg?width=681&name=codetagid.jpg)

Go to the code section of your CTA component and add a unique ID to the link. You can use the SiteManager ID variable \[:swpageitemid:\] that will be unique for every page component.

 

### 3. Tag Manager Trigger

Create a Google Tag Manager account, [https://tagmanager.google.com/#/home](https://tagmanager.google.com/#/home) if you have not already done so.

Find more information about Google Tag Manager here:

[https://support.google.com/tagmanager#topic=3441530](https://support.google.com/tagmanager#topic=3441530)

[https://developers.google.com/tag-manager/devguide](https://developers.google.com/tag-manager/devguide)

 

In the example below, you see we created two triggers when the A or B button is clicked

![tagtriggers](https://support.sitemanager.io/hs-fs/hubfs/tagtriggers.jpg?width=688&name=tagtriggers.jpg)

Configuration example of the trigger:

![tagtriggerconfig](https://support.sitemanager.io/hs-fs/hubfs/tagtriggerconfig.jpg?width=688&name=tagtriggerconfig.jpg)

 

### 4. Tag Manager Tags (Analytics)

After we build our triggers, we need to link them to our Google Analytics using tags.

We build two tags linking the respectable triggers to our linked Google Analytics.

![tagsexample](https://support.sitemanager.io/hs-fs/hubfs/tagsexample.jpg?width=688&name=tagsexample.jpg)

Example of the configuration of a tag:

![tagconfig](https://support.sitemanager.io/hs-fs/hubfs/tagconfig.jpg?width=688&name=tagconfig.jpg)

### 5. Google Analytics

Every time the A or B version of our CTA is clicked on the website, it will be pushed automatically as an event inside Google Analytics.

In Google Analytics, select Behaviour > Events > Overview

![analyticsmenu](https://support.sitemanager.io/hs-fs/hubfs/analyticsmenu.jpg?width=272&name=analyticsmenu.jpg)

In the example below, you can see the B version of our CTA is outperforming the A version.

![analyticsevents](https://support.sitemanager.io/hs-fs/hubfs/analyticsevents.jpg?width=688&name=analyticsevents.jpg)

The data for knowing how many times a certain version has been shown to a visitor can be found inside the SiteManager CMS, where the A/B testing rules have been set. In this example, we have done this in the settings of the Home page.

![smartviews](https://support.sitemanager.io/hs-fs/hubfs/smartviews.jpg?width=688&name=smartviews.jpg)

 

- [Getting Started](https://support.sitemanager.io/en/getting-started?hsLang=en)
- [Dashboard](https://support.sitemanager.io/en/dashboard?hsLang=en#main-content)
  
  
  
  
  
    - [Getting Started](https://support.sitemanager.io/en/dashboard?hsLang=en#getting-started)
    - [Project Dashboard](https://support.sitemanager.io/en/dashboard?hsLang=en#project-dashboard)
    - [White Label & Add-ons](https://support.sitemanager.io/en/dashboard?hsLang=en#white-label-add-ons)
    - [Go Live](https://support.sitemanager.io/en/dashboard?hsLang=en#go-live)
- [Account](https://support.sitemanager.io/en/account?hsLang=en#main-content)
  
  
  
  
  
    - [Account Settings](https://support.sitemanager.io/en/account?hsLang=en#account-settings)
    - [My Company](https://support.sitemanager.io/en/account?hsLang=en#my-company)
    - [Subscription](https://support.sitemanager.io/en/account?hsLang=en#subscription)
- [Project](https://support.sitemanager.io/en/project?hsLang=en#main-content)
  
  
  
  
  
    - [General](https://support.sitemanager.io/en/project?hsLang=en#general)
    - [Upgrade Project](https://support.sitemanager.io/en/project?hsLang=en#upgrade-project)
- [SEO](https://support.sitemanager.io/en/seo?hsLang=en#main-content)
  
  
  
  
  
    - [Basics](https://support.sitemanager.io/en/seo?hsLang=en#basics)
    - [Advanced](https://support.sitemanager.io/en/seo?hsLang=en#advanced)
- [Go Live](https://support.sitemanager.io/en/go-live?hsLang=en#main-content)
  
  
  
  
  
    - [Prepare Project](https://support.sitemanager.io/en/go-live?hsLang=en#prepare-project)
    - [Prepare Domain](https://support.sitemanager.io/en/go-live?hsLang=en#prepare-domain)
    - [Going Live](https://support.sitemanager.io/en/go-live?hsLang=en#going-live)
- [Content](https://support.sitemanager.io/en/content?hsLang=en#main-content)
  
  
  
  
  
    - [Getting Started](https://support.sitemanager.io/en/content?hsLang=en#getting-started)
    - [Page Management](https://support.sitemanager.io/en/content?hsLang=en#page-management)
    - [Content Management](https://support.sitemanager.io/en/content?hsLang=en#content-management)
    - [Language Management](https://support.sitemanager.io/en/content?hsLang=en#language-management)
    - [Image Library](https://support.sitemanager.io/en/content?hsLang=en#image-library)
    - [Collaborating on a project](https://support.sitemanager.io/en/content?hsLang=en#collaborating-on-a-project)
- [Page Components](https://support.sitemanager.io/en/page-components?hsLang=en#main-content)
  
  
  
  
  
    - [Getting Started](https://support.sitemanager.io/en/page-components?hsLang=en#getting-started)
    - [HTML](https://support.sitemanager.io/en/page-components?hsLang=en#html)
    - [CSS](https://support.sitemanager.io/en/page-components?hsLang=en#css)
    - [JavaScript (JS)](https://support.sitemanager.io/en/page-components?hsLang=en#javascript-js)
    - [How To](https://support.sitemanager.io/en/page-components?hsLang=en#how-to)
- [Layout Components](https://support.sitemanager.io/en/layout-components?hsLang=en)
- [No-Code Editor](https://support.sitemanager.io/en/no-code-editor?hsLang=en#main-content)
  
  
  
  
  
    - [Getting Started](https://support.sitemanager.io/en/no-code-editor?hsLang=en#getting-started)
    - [Properties](https://support.sitemanager.io/en/no-code-editor?hsLang=en#properties)
    - [Advanced](https://support.sitemanager.io/en/no-code-editor?hsLang=en#advanced)
- [Design](https://support.sitemanager.io/en/design?hsLang=en#main-content)
  
  
  
  
  
    - [Overview](https://support.sitemanager.io/en/design?hsLang=en#overview)
    - [Design editor](https://support.sitemanager.io/en/design?hsLang=en#design-editor)
    - [Design Panels](https://support.sitemanager.io/en/design?hsLang=en#design-panels)
    - [Responsive](https://support.sitemanager.io/en/design?hsLang=en#responsive)
    - [Fonts](https://support.sitemanager.io/en/design?hsLang=en#fonts)
    - [Layouts](https://support.sitemanager.io/en/design?hsLang=en#layouts)
- [Code](https://support.sitemanager.io/en/code?hsLang=en#main-content)
  
  
  
  
  
    - [Introduction](https://support.sitemanager.io/en/code?hsLang=en#introduction)
    - [Token Management](https://support.sitemanager.io/en/code?hsLang=en#token-management)
    - [Project Setup](https://support.sitemanager.io/en/code?hsLang=en#project-setup)
    - [ToolStack](https://support.sitemanager.io/en/code?hsLang=en#toolstack)
    - [Private Library](https://support.sitemanager.io/en/code?hsLang=en#private-library)
- [Dynamic Content](https://support.sitemanager.io/en/dynamic-content?hsLang=en#main-content)
  
  
  
  
  
    - [Getting started](https://support.sitemanager.io/en/dynamic-content?hsLang=en#getting-started)
    - [Basics](https://support.sitemanager.io/en/dynamic-content?hsLang=en#basics)
    - [Advanced](https://support.sitemanager.io/en/dynamic-content?hsLang=en#advanced)
- [External Content](https://support.sitemanager.io/en/external-content?hsLang=en#main-content)
  
  
  
  
  
    - [Getting started](https://support.sitemanager.io/en/external-content?hsLang=en#getting-started)
    - [Configuration & implementation](https://support.sitemanager.io/en/external-content?hsLang=en#configuration-implementation)
- [Logic (Smart Content)](https://support.sitemanager.io/en/logic-smart-content?hsLang=en#main-content)
  
  
  
  
  
    - [Getting Started](https://support.sitemanager.io/en/logic-smart-content?hsLang=en#getting-started)
    - [Configuration & Implementation](https://support.sitemanager.io/en/logic-smart-content?hsLang=en#configuration-implementation)
    - [Logic](https://support.sitemanager.io/en/logic-smart-content?hsLang=en#logic)
    - [AB testing](https://support.sitemanager.io/en/logic-smart-content?hsLang=en#ab-testing)
    - [Timed Content](https://support.sitemanager.io/en/logic-smart-content?hsLang=en#timed-content)
    - [Password Protected Content](https://support.sitemanager.io/en/logic-smart-content?hsLang=en#password-protected-content)
    - [Smart API](https://support.sitemanager.io/en/logic-smart-content?hsLang=en#smart-api)
- [Integrations](https://support.sitemanager.io/en/integrations?hsLang=en#main-content)
  
  
  
  
  
    - [Getting Started](https://support.sitemanager.io/en/integrations?hsLang=en#getting-started)
    - [Integrations](https://support.sitemanager.io/en/integrations?hsLang=en#integrations)
    - [Advanced](https://support.sitemanager.io/en/integrations?hsLang=en#advanced)
- [Modules](https://support.sitemanager.io/en/modules?hsLang=en#main-content)
  
  
  
  
  
    - [Getting Started](https://support.sitemanager.io/en/modules?hsLang=en#getting-started)
    - [Modules](https://support.sitemanager.io/en/modules?hsLang=en#modules)
- [Upgrade Center](https://support.sitemanager.io/en/upgrade-center?hsLang=en#main-content)
  
  
  
  
  
    - [Components](https://support.sitemanager.io/en/upgrade-center?hsLang=en#components)
- [Forms](https://support.sitemanager.io/en/forms?hsLang=en#main-content)
  
  
  
  
  
    - [General](https://support.sitemanager.io/en/forms?hsLang=en#general)
    - [Captcha](https://support.sitemanager.io/en/forms?hsLang=en#captcha)
    - [Form Actions](https://support.sitemanager.io/en/forms?hsLang=en#form-actions)
    - [Extending Forms](https://support.sitemanager.io/en/forms?hsLang=en#extending-forms)
    - [Email Templates](https://support.sitemanager.io/en/forms?hsLang=en#email-templates)
    - [Advanced](https://support.sitemanager.io/en/forms?hsLang=en#advanced)
- [Cookie Settings](https://support.sitemanager.io/en/cookie-settings?hsLang=en#main-content)
  
  
  
  
  
    - [Getting Started](https://support.sitemanager.io/en/cookie-settings?hsLang=en#getting-started)
    - [Configuration](https://support.sitemanager.io/en/cookie-settings?hsLang=en#configuration)
- [API Call](https://support.sitemanager.io/en/api-call?hsLang=en#main-content)
  
  
  
  
  
    - [Configuration](https://support.sitemanager.io/en/api-call?hsLang=en#configuration)

[![SiteManager Icon](https://support.sitemanager.io/hs-fs/hubfs/logo_icon_big.png?width=15&height=24&name=logo_icon_big.png "SiteManager Icon")](https://support.sitemanager.io/en?hsLang=en)

 

<https://www.facebook.com/TeamSiteManager/> <https://twitter.com/TeamSiteManager/> <https://www.instagram.com/teamsitemanager/> <https://www.linkedin.com/company/sitemanager/> <https://www.youtube.com/user/SiteMNGR/>

Copyright © 2026, SiteManager Group