Skip to content

Google Tag Manager

Install AnyTrack in Google Tag Manager automatically from the AnyTrack wizard, or manually via the official GTM Template, and trigger AnyTrack events through your existing GTM triggers for eCommerce platforms not natively integrated with AnyTrack.

Google Tag Manager (GTM) is a tag management system that lets you deploy and manage tracking tags on your website from an easy-to-use web-based interface.

You can install the AnyTrack Tracking Tag in your GTM container in two ways:

How AnyTrack Compares to Google Tag Manager

Section titled “How AnyTrack Compares to Google Tag Manager”

If you’re currently using Google Tag Manager, you know that you need to configure various triggers that will fire your tags according to the events you want to track.

Depending on the complexity of your setup, these triggers can be hard to configure.

With AnyTrack, event tracking functions such as outbound clicks and form submissions are automatically triggered and the variables associated with these events are automatically collected and sent to the AnyTrack servers.

Install Automatically from the AnyTrack Wizard

Section titled “Install Automatically from the AnyTrack Wizard”

The fastest way to install AnyTrack through Google Tag Manager is the Install via Google Tag Manager option in the AnyTrack onboarding wizard. AnyTrack connects to your GTM account through the Google Tag Manager API, adds the AnyTrack Tracking Tag to the container you select, and publishes the container — your Property ID, the tag configuration, and the trigger are all set up for you.

  1. In the wizard step that asks you to install the AnyTrack Tracking Tag, select Install via Google Tag Manager.
  2. Sign in with the Google account that has access to your Google Tag Manager container, and grant AnyTrack the requested access.
  3. Select your GTM account, container, and workspace

    Section titled “Select your GTM account, container, and workspace”
    Choose the GTM account, then the container that is installed on your website, then the workspace you want AnyTrack to use. Click Continue.
  4. Click Add Tag. AnyTrack adds the AnyTrack Tracking Tag, preconfigured with your Property ID, to the selected workspace.
  5. Click Apply, then Publish Now. AnyTrack publishes a new container version, and the Tracking Tag goes live on your website immediately.

After publishing, verify the installation with the AnyTrack Pixel Helper as described in the Validation section below.

Install the AnyTrack GTM Template Manually

Section titled “Install the AnyTrack GTM Template Manually”

If you prefer to configure GTM yourself, or your Google account cannot publish the container, install AnyTrack via the official Google Tag Manager Template available in the Google Tag Manager Template Gallery. For this method, keep your AnyTrack Property ID ready — you find it in Property Settings.

AnyTrack documentation screenshot

Follow the step-by-step guide to install the AnyTrack GTM Template.

AnyTrack documentation screenshot
AnyTrack documentation screenshot
  1. Section titled “Click on the Community Template Gallery option”
AnyTrack documentation screenshot
AnyTrack documentation screenshot

Select the AnyTrack Tracking Tag

  1. Click on the “Add to workspace” button.

    Section titled “Click on the “Add to workspace” button.”
AnyTrack documentation screenshot

By clicking on the Add button you confirm your selection.

AnyTrack documentation screenshot
  1. Locate the property ID and copy it to your clipboard (ctrl+c)
AnyTrack documentation screenshot
  1. Switch to the AnyTrack Tag Configuration
AnyTrack documentation screenshot
  1. Now paste the Property ID in the selected field.
AnyTrack documentation screenshot
  1. Now Click on Add Trigger configure the rule that will load the AnyTrack Tag.

Click on Add Trigger

  1. Select the “All Pages” option so that the AnyTrack Tag will load on every page where your container loads.

Select All Page Views

Now Save the AnyTrack Tag.

AnyTrack documentation screenshot
AnyTrack documentation screenshot
AnyTrack documentation screenshot
  1. Update the Container version name and description if you wish to and Click on Continue.
AnyTrack documentation screenshot

Video Tutorial: Install AnyTrack Tag via GTM

Section titled “Video Tutorial: Install AnyTrack Tag via GTM”

Watch this video for another detailed overview of how to install the AnyTrack Tag on your website using a Google Tag Manager container and trigger.

Play YouTube video

If you use an eCommerce platform that is not natively integrated with AnyTrack but already pushes eCommerce events to the GTM dataLayer, you can use your existing GTM triggers to fire AnyTrack event snippets. This lets you send standard events like Purchase, AddToCart, or ViewContent to AnyTrack without writing any additional tracking code on your site.

Use GTM to trigger AnyTrack events when your eCommerce platform already emits dataLayer events through GTM, but does not have a built-in AnyTrack integration. Common examples include:

  • Shopware
  • BigCommerce
  • Adobe Commerce (Magento)
  • PrestaShop
  • Any platform with a GTM eCommerce dataLayer implementation

If AnyTrack already has a native integration for your platform (such as Shopify or WooCommerce), use that instead. Native integrations handle event tracking and attribution automatically.

Your GTM container already has triggers that fire when eCommerce events occur (for example, when a purchase completes). You create a new Custom HTML tag that calls the AnyTrack event snippet, and attach it to those same triggers. AnyTrack receives the event with all the event attributes you pass, then sends the conversion data to your connected ad platforms.

Tag sequencing tells GTM to fire the AnyTrack Tracking Tag before your event snippet tag. This is required because the event snippet depends on the AnyTrack() function that the Tracking Tag loads.

  1. Open the Custom HTML tag that will contain your AnyTrack event snippet (created in Step 2 below)
  2. Scroll down to Advanced Settings and expand Tag Sequencing
  3. Check “A tag that fires before [this tag]”
  4. Select your AnyTrack Tracking Tag from the dropdown
  5. Check “Don’t fire [this tag] if the setup tag fails or is paused”

This ensures the Tracking Tag is fully loaded before the event snippet runs.

Create a new Custom HTML tag in GTM that calls the AnyTrack event snippet. Use the standard event names that AnyTrack supports, such as Purchase, AddToCart, InitiateCheckout, or ViewContent.

Map your existing GTM dataLayer variables to AnyTrack event attributes using GTM variable references ({{variable_name}}).

Example: Purchase Event

<script>
AnyTrack('trigger', 'Purchase', {
value: {{dlv - transaction total}},
currency: {{dlv - currency}},
transactionId: {{dlv - transaction id}},
email: {{dlv - customer email}},
items: {{dlv - items array}}
});
</script>

Replace the {{dlv - ...}} placeholders with the actual GTM variable names from your dataLayer configuration. For example, if your platform pushes the total purchase value to a variable called ecommerce.purchase.value, create a Data Layer Variable in GTM for that path and reference it here.

Example: AddToCart Event

<script>
AnyTrack('trigger', 'AddToCart', {
items: {{dlv - items array}},
value: {{dlv - item value}},
currency: {{dlv - currency}}
});
</script>

Example: ViewContent Event

<script>
AnyTrack('trigger', 'ViewContent', {
items: {{dlv - items array}}
});
</script>

Attach the same triggers you already use for your eCommerce tracking. For example, if you have a trigger that fires on the purchase dataLayer event, use that same trigger for your AnyTrack Purchase event snippet tag.

There is no need to create new triggers. The triggers you already have in your GTM container for events like purchase, add_to_cart, or view_item work with the AnyTrack event snippet tags.

  1. Open GTM Preview mode and complete a test transaction on your site
  2. Verify in the GTM debugger that the AnyTrack Tracking Tag fires before the event snippet tag
  3. Check the Conversions Report in your dashboard for the incoming event
  4. Install the AnyTrack Pixel Helper Chrome extension to confirm events fire in the browser
  5. Once verified, Submit and Publish your GTM container

You can trigger any standard event through GTM. The most common eCommerce events are:

Event NameWhen to TriggerRequired Attributes
ViewContentProduct page viewitems (with product id and price)
AddToCartItem added to cartitems, value, currency
InitiateCheckoutCheckout starteditems, value, currency
PurchaseOrder completedvalue, currency, transactionId, items

For the full list of supported event attributes, including customer data (email, name, phone) and product data (id, name, price, quantity), see the Event Attributes documentation.


Retrieve the atclid and Push It to the dataLayer

Section titled “Retrieve the atclid and Push It to the dataLayer”

Use this snippet to collect the AnyTrack click ID and make it available as a GTM variable. You can then use it to decorate forms, links, or pass it to other tags.

<script>
(function checkAtclid(attempts) {
if (typeof AnyTrack === 'function' && typeof AnyTrack.q === 'undefined') {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'atclid_ready',
atclid: AnyTrack('atclid')
});
} else if (attempts < 50) {
setTimeout(function() {
checkAtclid(attempts + 1);
}, 100);
}
})(0);
</script>


FAQ and Troubleshooting

FAQ was last reviewed on 2026-08-09

What is the difference between the automatic install and the GTM Template?
Both methods install the same AnyTrack Tracking Tag. The automatic install runs from the AnyTrack onboarding wizard: AnyTrack connects to your Google Tag Manager account through the GTM API, adds the Tracking Tag with your Property ID and trigger already configured, and publishes the container. The manual method uses the official AnyTrack Template from the Community Template Gallery, and you configure the tag, Property ID, trigger, and publishing yourself.
Does the automatic install publish my GTM container?
Yes. When you click Publish Now, AnyTrack publishes a new version of the container you selected, and the Tracking Tag goes live immediately. The Google account you select must have permission to publish that container. If your team reviews container changes before publishing, use the manual template method instead.
Do I need to disable my current Facebook, Google Ads, and other tracking tags?
Yes. Disable the tags for any ad platform you have connected in your AnyTrack account. AnyTrack loads those tags on your behalf, so keeping them active would create duplicate events.
Do I need to create triggers for standard events like AddToCart or FormSubmit?
It depends on the platform. If your platform has a native AnyTrack integration (like Shopify), AnyTrack tracks standard events automatically. If you are using a platform without a native integration, use your existing GTM triggers to fire the AnyTrack event snippet as described in the Trigger AnyTrack Events via GTM section above.
How do I test my GTM implementation?
Use the GTM Preview mode to step through your tags and verify firing order. Then check the Conversions Report in your dashboard to confirm events are arriving. The AnyTrack Pixel Helper Chrome extension also shows browser-side events in real time.
When should I use GTM to trigger AnyTrack events instead of a native integration?
Use GTM when your eCommerce platform does not have a built-in AnyTrack integration but already emits eCommerce events to the GTM dataLayer. Platforms like Shopware, BigCommerce, Adobe Commerce (Magento), and PrestaShop are common examples. If a native AnyTrack integration exists for your platform, use that instead.
Can I pass dataLayer variables to the AnyTrack event snippet?
Yes, and it is recommended. Map your GTM dataLayer variables to AnyTrack event attributes like value, currency, transactionId, email, and items. Use the standard GTM variable syntax (double curly braces) in your Custom HTML tag.
Why is my AnyTrack event snippet not firing?
The most common cause is that the AnyTrack Tracking Tag has not loaded before the event snippet fires. Set up tag sequencing in GTM so the Tracking Tag fires first. Open GTM Preview mode and verify the Tracking Tag appears before your event snippet in the firing order.
What standard events can I trigger through GTM?
You can trigger any AnyTrack standard event through GTM, including Purchase, AddToCart, InitiateCheckout, ViewContent, Lead, and more. Use the exact event names from the standard events documentation.
Can I trigger custom events through GTM?
Yes. If you have custom events that are not part of the standard event list, you can trigger them the same way. Use a Custom HTML tag with the AnyTrack event snippet and pass your custom event name. For example: AnyTrack('trigger', 'MyCustomEvent'). Attach it to whatever GTM trigger fits your use case.