Configuration

Google Tag Manager (GTM) Setup

Google Tag Manager serves as the primary dispatcher for client-side (storefront) tracking. Configure your GTM container with TrakIt to automatically manage tags, triggers, and variables.

Why Google Tag Manager Needs Sandboxed Integration

Shopify's checkout screens run on secure, sandboxed environments. Standard GTM container scripts pasted directly into the theme header are blocked from reading purchase values and customer attributes on checkout pages.

TrakIt bypasses this sandbox block by utilizing **Shopify's Web Pixels API**. We load a lightweight loader script inside a secure Shopify Custom Pixel sandbox. This pixel captures front-end milestones (such as item views, carts, checkouts, and purchases) and forwards data layer parameters directly to GTM, ensuring checkout actions are tracked accurately.


Prerequisite: Shopify Custom Pixel Installation

For GTM to intercept storefront events, you must install TrakIt's customer event pixel script in your Shopify admin panel:

Custom Pixel Installation Steps

  1. Log into your **Shopify Store Admin** dashboard.
  2. Go to SettingsCustomer events.
  3. Click Add custom pixel in the top-right corner.
  4. Name the pixel exactly: "TrakIt - Custom Pixel".
  5. Copy the Custom Pixel script block generated inside the top warning banner of TrakIt's GTM settings dashboard.
  6. Paste the script into Shopify's code editor workspace.
  7. Click Save, and then click the primary Connect button to activate the pixel handler.

Choose Integration Pathway

Configure your GTM container settings by selecting one of our setup tabs:

Manual

Manual Setup

Manually type your public GTM Container ID. Best if you do not want to connect Google account OAuth credentials. Requires manually downloading GTM JSON configurations and importing them to GTM.

View Manual Setup steps
Recommended
Auto

Automatic Setup

Log in with Google account OAuth. TrakIt automatically queries your tag manager account, creates a custom GTM container, populates it with all tracking components, and publishes it via API.

View Automatic Setup steps

1. Manual Setup Walkthrough

Step A: Retrieve Your Container ID

  1. Log into your Google Tag Manager workspace dashboard.
  2. Locate the public Container ID at the top of your workspace screen (formatted as GTM-XXXXXXX).
  3. Copy the ID and paste it into the Container ID field inside TrakIt.
  4. Click Save in the GTM Configuration card.

Step B: Google Tag Manager (GTM) Container Sync

To load GTM web tracking tags onto your storefront, the tag layout configuration must be synced with your Google Tag Manager (GTM) workspace:

Automatic GTM Import (Recommended)

If your Google Account is connected to TrakIt, all Google Tag Manager tags, triggers, and configurations will be imported automatically into your GTM container via GTM API. There is no need to download or upload container files manually.

If your Google account is not connected, you must download the container JSON file from TrakIt's right-hand sidebar and import it manually:

How to import manually into GTM:

  1. Open your Google Tag Manager workspace.
  2. Go to AdminImport Container.
  3. Upload the downloaded container file.
  4. Choose Merge.
  5. Click Confirm to integrate the tag configurations.

* Note: Since we automatically import the tags into the container when the Google account is connected, there is no need to manually import it.

Configuration Changes

In Manual Setup mode, whenever you change your GTM Container ID or modify configured tracking events, you **must re-download and re-import** the container JSON workspace file to sync variables.


2. Automatic Setup Walkthrough (OAuth)

  1. Select the **Automatic Setup** tab in GTM Configuration.
  2. Click Connect with Google to grant TrakIt permission to read accounts and manage containers.
  3. Select your GTM Account from the dropdown.
  4. Enter a custom container name (TrakIt generates a default suggestion based on your shop name, e.g. [TrakIt] StoreName - 1781322286).
  5. Click Create & Setup Container.
  6. TrakIt executes the deployment in the background:
    • Calls GTM API to create the container.
    • Injects all required tags, triggers, and mapping variables for your active tracking integrations.
    • Publishes the container version to make it live instantly.

Update Container Tags Action

Once automatic setup is active, TrakIt displays an **Update Container Tags** button. If you configure new channels (such as Klaviyo or Pinterest) or adjust event rules, click this button to push container tag updates directly to your live workspace — no file downloads required.


Unlinking & Cleanup

To disconnect GTM or replace container connections:

  1. Click Disconnect in the Disconnect panel.
  2. Cleanup behavior:
    • For Automatic Setup: TrakIt uses GTM API to automatically delete injected tags, triggers, and variables from the workspace.
    • For Manual Setup: Clears TrakIt local configuration records (tags must be deleted manually from your GTM dashboard).
  3. Navigate to Shopify Settings → Customer events, and disconnect the TrakIt Custom Pixel script.