# Event Snippet

> A small JavaScript call that uses AnyTrack('trigger', eventName, { attributes }) on a page to fire a standard or custom event with its attributes, on top of the events the Tracking Tag captures automatically.

An event snippet is a small JavaScript call you place on a page — `AnyTrack('trigger', '<EventName>', { attributes })` — that fires a standard or custom [event](/glossary/event) with its [event attributes](/glossary/event-attributes). It runs on top of the automatic events the [Tracking Tag](/glossary/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.

## What an event snippet is made of

Every AnyTrack event snippet has three parts: the **trigger** (the `AnyTrack('trigger', …)` command that generates the event), the **event name** (a [standard event](/glossary/standard-conversions) like `Purchase` or a custom name like `Optin`), and the **event attributes** (the customer, product, and transaction data passed in the object). Standard event names are mapped to each ad platform automatically; custom names must be mapped manually before a platform can optimize against them.

## Event snippet vs Tracking Tag vs Event Attributes

- [Tracking Tag](/glossary/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](/glossary/event-attributes) — the data the snippet sends; the snippet itself is the code that sends it.

## How AnyTrack uses the event snippet

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 Conversion Report and forwards it server-side to every connected ad platform via the [Conversion API](/glossary/conversion-api). 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](/glossary/conversion-payload) to a webhook — covers actions that happen off the page.
