Skip to main content

Installing Agility Pixels Using Google Tag Manager

Instructions for installing Agility Pixels via GTM to enable enterprise-level tracking and campaign performance insights.

Updated today

Overview

This article outlines the technical requirements for installing Agility Pixels through Google Tag Manager (GTM). Implementing this setup will provide your organization with enterprise-grade tracking, enabling robust reporting and optimization insights.

For assistance, contact [email protected].

Notes:

  • Tag Type: All new tags should use the "Custom HTML" type.

  • Recommended Access: To streamline setup, we recommend providing our team with "Edit" access to your GTM container. You can review and publish after verifying the configuration. How to Share Access


Variables for Dynamic Parameters

These variables must be created or sourced from your existing GTM container. They are used across most Agility Pixels.

Variable

Description

Event Value

This parameter will pass the specific value associated with each pixel. For example: in the case of Add to Cart, it will capture the monetary value of the item added to the cart.

User ID

This parameter represents the User ID your company uses to identify individual users. If a custom User ID is not already defined, you can use the GA4 User ID from the GA4 cookie as a fallback.

Session ID

This parameter represents the Session ID associated with each user's session. If your site does not already generate a Session ID, please create one. Below is an example we’ve used in the past, though it may need to be adjusted depending on your website’s setup.

Line Item Names

When applicable, this variable will be a single string that concatenates the names of all items involved. For example: for the Checkout Start event, the expected output would be a string of all item titles combined.

Item 1: Basil Oil
Item 2: Bergamot
Expected Line Item Names: Basil Oil_Bergamot

Page Path

Built-in GTM variable {Page Path}.

Click Text

Built-in GTM variable {Click Text}.

Item Count

Number of items involved in the action (e.g. 3 items added to cart).

Order ID

Unique identifier for the transaction.

Revenue

Total value of the transaction.

Currency

Currency used in the transaction (e.g. USD).

If your site does not automatically generate a Session ID, you can implement one using the following custom JavaScript function in GTM:

function() {
const key = 'custom_session_id';
const sessionTimeout = 60 * 60 * 1000; // 60 minutes in milliseconds
const now = Date.now();

try {
const stored = JSON.parse(localStorage.getItem(key)) || {};

// If expired or missing, generate a new session ID
if (!stored.id || (now - stored.timestamp > sessionTimeout)) {
const newSessionId = 'sess_' + now + '_' + Math.floor(Math.random() * 1e9);
localStorage.setItem(key, JSON.stringify({
id: newSessionId,
timestamp: now
}));
return newSessionId;
}

return stored.id;
} catch (e) {
// Fallback if localStorage fails
return 'sess_' + now + '_' + Math.floor(Math.random() * 1e9);
}
}

Pixels to Install

1. Agility - Universal Pixel

  • Tag recommended name:

    • Agility - Universal Pixel

  • Code:

      <script src="sampleURL" type="text/javascript"></script>
    <script type="text/javascript">
    , {
    "td2": {User ID},
    "td3": {Session ID},
    "td5": {Page Path},
    "td6": {Click Text},
    "td9": Any_Page_View
    });
    }
    });
    </script>
  • Implementation:

    • The Trigger should fire in “All Pages” in the following Domains:

      • clientdomain.com

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

      • Click Text

2. Agility - Successful Purchase

  • Tag recommended name:

    • Agility - Successful Purchase

  • Code:

    <img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&orderid={{Order ID}}&td1={{Event Value}}&td10={{Order ID}}&td2={{User ID}}&td3={{Session ID}}&td4={{Line Item Names}}&td5={{Page Path}}&td6={{Click Text}}&td7={{Item Count}}&td9=Sales_Realization&v={{Revenue}}&vf={{Currency}}"/>
  • Implementation:

    • It should fire in a successful transaction

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • Event Value

        • The total price of the transaction

      • User ID

      • Session ID

      • Line Item Names

        • A single string that contains all the names from the items

      • Page Path

      • Click Text

      • Item Count

        • The total amount of purchased products

      • Event ID

        • The Order ID

      • Order ID

        • The Order ID

      • Currency

        • The currency of the transaction

      • Revenue

        • The total price of the transaction

3. Agility - Sales Activation

  • Tag recommended name:

    • Agility - Sales Activation

  • Code:

    <img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td1={{Event Value}}&td2={{User ID}}&td3={{Session ID}}&td4={{Line Item Names}}&td5={{Page Path}}&td6={{Click Text}}&td7={{Item Count}}&td9=Add_to_Cart_OR_View_Cart"/>
  • Implementation:

    • It will have two triggers:
      1. Add to Cart
      2. View Cart

  • It should pass the following values, please rename them with your own variables that already exist in your GTM.

    • Event Value

      • The value of the Items added to cart, or the value of the cart viewed

    • User ID

    • Session ID

    • Line Item Names

      • A single string that contains all the names from the items

    • Page Path

    • Click Text

    • Item Count

      • The total amount of items added to cart or items in the cart

    • Currency

4. Agility - Sales Activation - Variant

  • Tag recommended name:

    • Agility - Sales Activation - Variant

  • Code:

    <img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td1={{Event Value}}&td2={{User ID}}&td3={{Session ID}}&td4={{Line Item Names}}&td5={{Page Path}}&td6={{Click Text}}&td7={{Item Count}}&td9=NAME_OF_THE_ACTION&vf={{Currency}}"/>
  • Implementation:

    • It should fire in the following actions.

      • When someone adds an item to a bag

      • When Someone view their cart

      • When someone proceeds to checkout

      • When Someone clicks “Continue” in Shipping page

      • In the Checkout Pages

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • Event Value

      • User ID

      • Session ID

      • Line Item Names

        • A single string that contains all the names from the items

      • Page Path

      • Click Text

      • Item Count

5 . Agility - Sales Realization - Variant

  • Tag recommended name:

    • Agility - Sales Realization - Variant

  • Code:

    <img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td1={{Event Value}}&td2={{User ID}}&td3={{Session ID}}&td4={{Line Item Names}}&td5={{Page Path}}&td6={{Click Text}}&td7={{Item Count}}&td9=checkout3_checkout4_OrderConfirmationPage_OrderStatus&vf={{Currency}}"/>
  • Implementation:

    • It should fire in all the following events:

      • When someone clicks “Review Order” from the Payment page

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • Event Value

      • User ID

      • Session ID

      • Page Path

      • Click Text

      • Item Count

      • Event ID

      • Order ID

      • Currency


High Intent Pixels

Each event below should have a dedicated tag and trigger. However, we will also reuse all of these Triggers for a separate tag named High Intent Event.

1. Agility - Search Result

  • Tag recommended name:

    • Agility - Search Result

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com&td2={{User ID}}&td3={{Session ID}}&td4={{Line Item Names}}&td5={{Page Path}}&td7={{Item Count}}&td8={{Search Query}}&td9=Search_Results"/>
  • Implementation:

    • It should fire when someone does a search in your website search tool

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

      • Search Query

        • The query for the the search

2. Agility - Live Chat

  • Tag recommended name:

    • Agility - Chat Now

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com=& td2={{User ID}}&td3={{Session ID}}&td5={{Page Path}}&td9=Live_Chat"/>
  • Implementation:

    • It should fire when someone clicks the live chat button

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

3. Agility - Phone Number

  • Tag recommended name:

    • Agility - Phone Number

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td2={{User ID}}&td3={{Session ID}}&td5={{Page Path}}&td6={{Page Path}}&td9=Phone_Number"/>
  • Implementation:

    • It should fire anytime someone calls a number from your website

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

      • Click Text

4. Agility - Download a File

  • Tag recommended name:

    • Agility - Download a File

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td2={{User ID}}&td3={{Session ID}}&td5={{Page Path}}&td6={{Click Text}}&td9=Download_a_File"/>
  • Implementation:

    • It should fire when someone downloads a file from your website

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

      • Click Text

5. Agility - Links to “Help” subdomain

  • Tag recommended name:

    • Agility - Link to help subdomain

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td2={{User ID}}&td3={{Session ID}}&td5={{Page Path}}&td6={{Click Text}}&td9=Links_to_Help"/>
  • Implementation:

    • It should fire when a user clicks in a button or link that re-directs you to the “Help” Subdomain

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

      • Click Text

6. Agility - Social Media

  • Tag recommended name:

    • Agility - Social Media

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td2={{User ID}}&td3={{Session ID}}&td5={{Page Path}}&td6={{Click Text}}&td9=Social_Media_Buttons"/>
  • Implementation:

    • It should fire when someone clicks a Social Media Link

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

      • Click Text

7. Agility - Create Account

  • Tag recommended name:

    • Agility - Create Account

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td2={{User ID}}&td3={{Session ID}}&td7={{Item Count}}&td9=Create_Account"/>
  • Implementation:

    • It should fire when someone creates an account

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

8. Agility - Collection Pages

  • Tag recommended name:

    • Agility - High Intent

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td2={{User ID}}&td3={{Session ID}}&td4={{Line Item Names}}&td5={{Page Path}}&td8={{Collection Names}}&td9=Live_Chat"/>
  • Implementation:

    • It should fire in the Collection pages

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

      • Line Item Names

        • An string that contains all the items

      • Collection Name

        • The name of the collection

9. Agility - Item Pages

  • Tag recommended name:

    • Agility - High Intent

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td1={{Event Value}}&td2={{User ID}}&td3={{Session ID}}&td4={{Line Item Names}}&td5={{Page Path}}&td9=Item_Pages&vf={{Currency}}"/>
  • Implementation:

    • It should fire in the Collection pages

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • User ID

      • Session ID

      • Page Path

      • Line Item Names

        • The name of the item

      • Event Value

        • The value of the Item

      • Currency

10. Agility - High Intent

  • Tag recommended name:

    • Agility - High Intent

  • Code:

<img height="1" width="1" style="border-style:none;" alt="" src="sample.com=&td1={{Event Value}}&td2={{User ID}}&td3={{Session ID}}&td5={{Page Path}}&td6={{Click Text}}&td9=THIS_IS_THE_NAME_OF_THE_TRIGGER&vf={{Currency}}"/>

Dynamic Pixels

These pixels use Agility’s dynamic tracking system and are triggered by common eCommerce events.

  1. Agility - Dynamic - Universal Pixel

  • Tag recommended name:

    • Agility - Dynamic - Universal Pixel

  • Code:

<!-- Dynamic Pixel Code -->
<script type='text/javascript'>
!function(c, l, e, v, n, t, s)
{
if (c.clq) return; n = c.clq = function() { n.callMethod? n.callMethod.apply(n, arguments) : n.queue.push(arguments) };
if (!c._clq) c._clq = n; n.push = n; n.loaded = !0; n.version = '2.0'; n.queue = [];
t = l.createElement(e); t.async = !0; t.src = v; s = l.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s)
}
(window, document, 'script', 'https://sample.com.js');
clq('init', 'eogn4QI', {'cid':'wkvb4TU', 'product':'ecommerce'});
clq('track', 'PageView');
</script>
<!-- End Dynamic Pixel Code -->
  • Implementation:

    • The Trigger should fire in “All Pages” in the following Domains:

      • client.com

2. Agility - Dynamic - Search Result

  • Tag recommended name:

    • Agility - Dynamic - Search Result

  • Code:

<script>
clq('track', 'Search',{ content_type: 'product', content_ids: {{Contents_IDS}}, search_string: {{Search Querry}} });
</script>
  • Implementation:

    • It should fire when someone does a search in your website search tool

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • {{Search Query}}

        • The query for the the search

      • {{Contents_IDS}}

        • The IDs of the content items that appear when performing a search

3. Agility - Dynamic - Collection Pages

  • Tag recommended name:

    • Agility - Dynamic - Collection Pages

  • Code:

<script>
clq('track', 'ViewCategory',{ content_type: 'product', content_ids: {{Line Item Names}}, content_category: {{Collection Name}} });
</script>
  • Implementation:

    • It should fire in the Collection pages

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • {{Line Item Names}}

        • An string that contains all the items

      • {{Collection Name}}

        • The name of the collection

4. Agility - Dynamic - Item Pages

  • Tag recommended name:

    • Agility - Dynamic - Item Pages

  • Code:

<script>
clq('track', 'ViewContent',{ value: {{Event Value}}, currency: {{Currency}}, content_type: 'product', content_ids: {{Content IDs}} });
</script>
  • Implementation:

    • It should fire in the Item Pages

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • {{Event Value}}

        • The value of the Item

      • {{Currency}}

      • {{Content IDs}}

        • The ID of the Item

5. Agility - Dynamic - Add to Cart

  • Tag recommended name:

    • Agility - Dynamic - Add to Cart

  • Code:

<script>
clq('track', 'AddToCart',{ value: {{Event Value}}, currency: {{Currency}}, content_type: 'product', content_ids: {{Content IDs}} });
</script>
  • Implementation:

    • It should fire when someone clicks add to Bag button

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • {{Event Value}}

        • The value of the Item

      • {{Currency}}

      • {{Content IDs}}

        • The ID of the Item

6. Agility - Dynamic - Cart Page

  • Tag recommended name:

    • Agility - Dynamic - Cart Page

  • Code:

<script>
clq('track', 'CartPage',{ content_type: 'product', content_ids: {{Content IDs}} });
</script>
  • Implementation:

    • It should fire when a user sees their Cart

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • {{Content IDs}}

        • The ID of the Item

7. Agility - Dynamic - Start Checkout

  • Tag recommended name:

    • Agility - Dynamic - Start Checkout

  • Code:

<script>
clq('track', 'InitiateCheckout',{ value: {{Event Value}}, currency: {{Currency}}, content_type: 'product', content_ids: {{Content IDs}} });
</script>
  • Implementation:

    • When someone proceeds to checkout

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • {{Event Value}}

        • The value of the Item

      • {{Currency}}

      • {{Content IDs}}

        • The ID of the Item

8. Agility - Dynamic - Checkout Completed

  • Tag recommended name:

    • Agility - Dynamic - Checkout Completed

  • Code:

<script>
clq('track', 'Purchase',{ value:{{Event Value}}, currency: {{Currency}}, content_type: 'product', content_ids: {{Content IDs}}, order_id: {{Order ID}} });
</script>
  • Implementation:

    • It should fire when someone successfully checkouts

    • It should pass the following values, please rename them with your own variables that already exist in your GTM.

      • {{Event Value}}

        • The value of the Item

      • {{Currency}}

      • {{Content IDs}}

        • The ID of the Item

      • {{Order ID}}

        • The ID of the Item


Implementation Steps

1. Review

Evaluate the plan and confirm it aligns with your internal tracking standards.

2. Access

Grant GTM access to [email protected]. Access is used only to verify data collection. No changes will be made in your GA4 account.

3. Installation

Choose one of the following:

  • Option 1: The Agility team completes implementation within three business days after access and plan approval.

  • Option 2: Schedule a working session for real-time implementation with your team.

Did this answer your question?