Skip to content

An event snippet is a small JavaScript call you place on a page β€” AnyTrack('trigger', '<EventName>', { attributes }) β€” that fires a standard or custom event with its event attributes. It runs on top of the automatic events the Tracking Tag already collects (PageView, OutboundClick, FormSubmit), letting you track actions the Tag can’t infer on its own, such as a button click, a video play, or a quiz completion.

Every AnyTrack event snippet has three parts: the trigger (the AnyTrack('trigger', …) command that generates the event), the event name (a standard event like Purchase or a custom name like Optin), and the event attributes (the customer, product, and transaction data passed in the object). Most standard event names have a default mapping on each ad platform. On Google Ads, you select a conversion action for each event. Custom names must be mapped manually before a platform can optimize against them.

  • Tracking Tag β€” the single base script installed once in the page <head>; an event snippet is an extra trigger that needs the Tag loaded first.
  • Event Attributes β€” the data the snippet sends; the snippet itself is the code that sends it.

Add an event snippet only to the page where the specific action happens β€” the Tracking Tag handles page-wide automatic tracking everywhere else. When the snippet fires, AnyTrack records the event in the Conversions Report and sends it server-side via the Conversion API to each connected ad platform that has a mapping for it. Validate a new snippet with the Tracking Tag Helper Chrome extension before relying on it. A server-side equivalent β€” sending the same event as a conversion payload to a webhook β€” covers actions that happen off the page.

Frequently asked questions

FAQ was last reviewed on 2026-06-25

Does an event snippet work without the Tracking Tag?
No. Every event snippet requires the Tracking Tag to be loaded in the page head first. If the snippet runs before the Tag code is on the page, which is common when a tag manager deploys the Tag, the event does not fire. When the Tag code is in the page head, the Tag holds the snippet calls that run before it loads and sends them when it loads. Install the Tag directly in the head, or delay the snippet.
What does an event snippet return?
It returns a click_id value (for example IBTO9lOfAMybrKiiB1U9YG91IFjs3Dv9AV) that you can push to your CRM to connect an offline conversion back to the original ad click.