Skip to content

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.

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, and FormSubmit events 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.

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 TagEvent snippet
What it isAnyTrack’s base client-side scriptA one-line trigger call: AnyTrack('trigger', ...)
JobFoundation: sessions, IDs, attribution data, automatic events, pixel loadingFires one specific event you define
Where it goesThe <head> of every pageOnly the page where the action happens
How many you needOne per propertyOne per action you want to track
Who writes itGenerated by AnyTrack in Property SettingsYou or your developer
Events it tracksPageView, OutboundClick, FormSubmit automaticallyAny standard or custom event, with attributes
Depends onNothing; it is the foundationThe 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.

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.

  • 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?
Only for actions the Tracking Tag does not track automatically. The Tag records page views, form submissions, and outbound clicks on its own, and connected integrations send conversions like purchases server-side. Add a snippet when you want to track a specific on-page action such as a button click or a video play.
Does an event snippet work without the Tracking Tag?
No. Every event snippet calls the AnyTrack function that the Tracking Tag creates, so the Tag must be loaded in the page head first. If the snippet runs before the Tag finishes loading, the event will not fire.
Should I add event snippets to every page?
No. Add a snippet only to the page where the specific action occurs. The Tracking Tag handles automatic tracking across all pages, so duplicating snippets site-wide creates noise without adding data.
What does an event snippet return?
It returns a 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.
Why is my event snippet not firing?
The most common cause is the snippet executing before the Tracking Tag finishes loading, which often happens when the Tag is deployed through a tag manager. Fire the snippet after the Tag loads, install the Tag directly in the page head, or add a short delay. See the Custom Event Tracking guide for each solution.