Tracking Tag vs Event Snippet
Understand the difference between the AnyTrack Tracking Tag and an event snippet: what each script does, which events they track, when you need an event snippet, and why every snippet depends on the Tracking Tag being loaded first.
What is the difference between the AnyTrack Tracking Tag and an event snippet? Both are JavaScript that runs on your website, and that is where the similarity ends. The Tracking Tag is the base script you install once in your site’s <head>: it opens sessions, collects attribution data, and tracks page views, form submissions, and outbound clicks automatically on every page. An event snippet is a small extra trigger you place on a specific page to record an action the Tag cannot detect on its own, such as a button click or a video play. Every event snippet depends on the Tracking Tag being loaded first.
What the Tracking Tag Is
Section titled “What the Tracking Tag Is”The Tracking Tag is AnyTrack’s own client-side script, unique to each property. You install it once in the <head> section of every page in your funnel, and from there it works page-wide without any extra code:
- Opens the session and assigns the Client ID, the first-party cookie that anonymously identifies the visitor.
- Generates the Page Click ID (
atclid) on page load and a Click ID for each trackable element. - Collects UTM parameters and referrers as first-party data for attribution.
- Runs AutoScan, AutoTrack, and AutoTag to find trackable links and forms and append the Click ID automatically.
- Tracks
PageView,OutboundClick, andFormSubmitevents on its own. - Loads your connected ad platform pixels (Meta Pixel, Google Tag) with the right identifiers.
You never write the Tracking Tag yourself. Copy it from Property Settings under the Tracking Script tab and paste it into your site.
What an Event Snippet Is
Section titled “What an Event Snippet Is”An event snippet is a single JavaScript call that fires one event, with the data you choose to attach. It runs on top of the automatic events the Tracking Tag already collects. Every snippet has three parts: the trigger command, the event name (a standard event like Purchase or a custom name like Optin), and the event attributes that enrich the conversion with customer and product data.
<script> var click_id = AnyTrack('trigger', 'ViewContent', { brand: 'Nike', label: 'shoes', value: 199.00, currency: 'USD' });</script>The snippet returns a click_id value that you can push to your CRM to connect an offline conversion back to the original ad click.
Unlike the Tracking Tag, an event snippet belongs only on the page where the action happens. Standard event names are mapped to each ad platform automatically; custom names require manual mapping before a platform can optimize against them. The full setup is covered in Custom Event Tracking.
Tracking Tag vs Event Snippet at a Glance
Section titled “Tracking Tag vs Event Snippet at a Glance”| Tracking Tag | Event snippet | |
|---|---|---|
| What it is | AnyTrack’s base client-side script | A one-line trigger call: AnyTrack('trigger', ...) |
| Job | Foundation: sessions, IDs, attribution data, automatic events, pixel loading | Fires one specific event you define |
| Where it goes | The <head> of every page | Only the page where the action happens |
| How many you need | One per property | One per action you want to track |
| Who writes it | Generated by AnyTrack in Property Settings | You or your developer |
| Events it tracks | PageView, OutboundClick, FormSubmit automatically | Any standard or custom event, with attributes |
| Depends on | Nothing; it is the foundation | The Tracking Tag must load first |
Bottom line: the Tracking Tag is mandatory for every AnyTrack setup; event snippets are optional extras you add when the automatic events do not cover an action you care about.
Why Every Snippet Needs the Tag
Section titled “Why Every Snippet Needs the Tag”The Tracking Tag initializes the AnyTrack function that every event snippet calls. Without the Tag on the page, the snippet has nothing to talk to, so the event never reaches AnyTrack.
Timing matters too. If a snippet executes before the Tag finishes loading, the event does not fire. This happens most often when the Tag is deployed through a tag manager, which adds a loading delay. Install the Tag directly in the page <head>, configure your tag manager to fire the snippet after the Tag loads, or add a short delay to the snippet. The Custom Event Tracking guide walks through each fix.
When You Need an Event Snippet
Section titled “When You Need an Event Snippet”- You need one for on-page actions the Tag cannot infer: button clicks, video plays, quiz completions, or a custom funnel step unique to your business.
- You do not need one for page views, form submissions, or outbound clicks. The Tracking Tag tracks these automatically on every page.
- You do not need one for conversions from connected integrations. Platforms like Shopify or your affiliate networks send purchases and leads to AnyTrack server-side.
- Use a webhook instead when the action happens off the page, such as a sale closed in your CRM. Sending the conversion server-side covers what no on-page script can see.
FAQ
FAQ was last reviewed on 2026-07-07
Do I need an event snippet if the Tracking Tag is already installed?
Does an event snippet work without the Tracking Tag?
Should I add event snippets to every page?
What does an event snippet return?
click_id value that you can push to your CRM. This lets you connect an offline conversion, such as a closed deal, back to the original ad click for attribution.