Skip to content

Learn how to track custom events like button clicks, form views, and video plays using the AnyTrack Event Snippet. Covers the trigger command, standard and custom event names, event attributes for enriching conversion data, default event mapping to ad platforms, and validation using the AnyTrack Pixel Helper extension.

Custom events are user-defined tracking events specific to a property’s goals — beyond AnyTrack’s standard events like Purchase, Lead, or ViewContent. They let you track unique actions such as button clicks, video plays, scroll depth, or quiz completions, then send that enriched data via Conversion API to each connected ad platform that has a mapping for the event, for attribution, audience building, and campaign optimization.

Custom events give you complete control over what gets tracked and when, so ad platforms receive the exact signals they need to optimize performance.

Every AnyTrack event snippet has three parts:

  1. The Trigger: The command that generates the event.
  2. The Event Name: Standard event (like ViewContent, Lead, Purchase) or custom event name.
  3. The Event Attributes: Customer data (email, phone), product details (SKU, value, currency), and other context that enriches your tracking. See the complete list of Event Attributes.
<script>
var click_id = AnyTrack('trigger', 'ViewContent', {
brand: 'Nike',
label: 'shoes',
value: 199.00,
currency: 'USD'
});
</script>

Use custom event names when standard events don’t match your tracking needs:

<script>
var click_id = AnyTrack('trigger', 'Optin');
</script>

Most standard events have a default mapping on each ad platform, except Google Ads, where you select a conversion action for each event. Custom events require manual mapping — follow our guide to map custom events to your ad platforms so platforms can use them for optimization.

Send customer data and product details with every event to boost Event Match Quality and give ad platforms the rich signals they need to optimize effectively. Higher Event Match Quality means better attribution, smarter targeting, and improved ROAS.

<script>
var click_id = AnyTrack('trigger', 'Optin', {
formId: 'form82323',
brand: 'newsletter',
email: 'jondoe@email.com'
});
</script>

Attributes like email, phone, value, currency, and transactionId flow to AnyTrack and to each ad platform that receives the event, giving you consistent, enriched data everywhere.

See all supported Event Attributes.

Catch tracking issues before they cost you money. Validation takes 30 seconds using the AnyTrack Pixel Helper Chrome Extension.

Step 1: Verify the snippet is found

Navigate to the page where you added the snippet, open the AnyTrack Pixel Helper Chrome Extension, and click “Snippets found.” Your custom event snippet should appear in the list.

The AnyTrack Pixel Helper Chrome Extension shows all the event snippets found on the page.
The AnyTrack Pixel Helper extension shows all event snippets found.

Step 2: Confirm the event fired

On the same page, check the AnyTrack Pixel Helper again. A green checkmark with timestamp means the event triggered successfully. Click the ClientId link to view details.

Click the ClientId link to see the event in the Conversions Report.
if successful, the event and its identifiers will be visible.

Step 3: Review in Conversions Report

The ClientId link opens the Conversions Report showing your triggered event. Verify the event data looks correct, then map the event to your connected ad platforms so they can receive and use the conversion signals.

The Conversions Report will show the events triggered by the snippet code.
The Conversions Report will show the events triggered by the snippet code.

If the AnyTrack Pixel Helper shows both the Tag and the event snippet are installed but the event is not firing, the snippet probably runs before the Tag code is on the page. This commonly happens when a tag manager loads the Tag.

When the Tag code is in the page <head>, it runs before your event snippets. The Tag code holds the snippet calls that run before the Tag script loads, and the Tag sends them when it loads. When the snippet runs before the Tag code is on the page, AnyTrack is not defined. The Tag does not send the event.

Solution 1: Configure your tag manager to fire the event snippet after the Tracking Tag loads completely.

Solution 2: Install the Tracking Tag directly in your page <head> section instead of through a tag manager. The Tag code then runs before your event snippets.

Solution 3: Add a delay to the snippet, giving the Tag time to load:

<script>
var delay = 2000; // Delay in milliseconds (2 seconds)
function triggerAnyTrack() {
var click_id = AnyTrack('trigger', 'SignUp');
}
setTimeout(triggerAnyTrack, delay);
</script>

FAQ & Troubleshooting

FAQ was last reviewed on 2026-12-04

What is the difference between standard and custom events?
Most standard events, such as Purchase, Lead, and ViewContent, have a default mapping to the equivalent event on each ad platform. Google Ads has no default mapping: you select a conversion action for each event. Custom events use your own names and require manual mapping in your ad platform. See the custom event mapping guide for setup instructions.
Do I need to add event snippets to every page?
No. Add event snippets only to pages where the specific action occurs. The Tracking Tag handles automatic tracking (page views, outbound clicks, form submissions) across all pages.
How do I validate that my custom event is working?
Use the AnyTrack Pixel Helper Chrome extension to verify the snippet is found and the event fires. Then check the Conversions Report in your dashboard to confirm the event data.