Send custom events with the FunnelTrack pixel
Fire any event you want — Item View, Add to Cart, Email Opt-In, custom milestones — directly from your site's HTML or your tag manager. Drop in a one-liner where the event happens, optionally attach hashed email or phone, and FunnelTrack routes the event to every connected destination with full attribution.
- •The FunnelTrack pixel deployed on every page where you want to fire custom events
- •At least one connected destination (Meta CAPI, Google Ads, GA4, TikTok CAPI, etc.)
- •The Pixel Custom Events source connected in FunnelTrack → Integrations
1. Fire a custom event
One line of JavaScript, anywhere on your page.
The simplest call
Once the FunnelTrack pixel has loaded, the global window.ft exposes a single method:
window.ft.event("event_name", { /* optional params */ });That's it. The event is tied to the current pixel session, so all click IDs (gclid, fbclid, ttclid, etc.) and the original ad landing context come along for the ride.
Add identity (recommended)
Pass email or phone in the params and FunnelTrack hashes them in the browser with SHA-256 before they ever leave the page. Raw values never touch our servers.
window.ft.event("email_opt_in", {
email: "jane@example.com",
// phone, first_name, last_name, city, region, zip, country also accepted
});window.crypto.subtle, which only works over HTTPS (or localhost). On plain http://the user-data fields are dropped and the event still fires — but you won't get cross-session contact matching. Make sure your site is on HTTPS.Add value and currency
For monetary events (Add to Cart, Purchase, Subscribe, etc.) pass value and currency. Both become event properties — destinations that support revenue events (Meta CAPI, Google Ads, GA4, TikTok CAPI) will forward them.
window.ft.event("add_to_cart", {
value: 49.00,
currency: "USD",
// mix freely with user data:
email: "jane@example.com",
});2. Copy-paste recipes
Drop these straight into your site or GTM.
Item View
Fire on a product / collection / pricing page load. Replace PRODUCT_ID etc. with your own values (server-rendered or pulled from the page).
<script>
// Wait until the FunnelTrack pixel has loaded on the page,
// then fire the event.
(function fire() {
if (window.ft && window.ft.event) {
window.ft.event("item_view", {
item_id: "PRODUCT_ID",
item_name: "PRODUCT_NAME",
value: 49.00,
currency: "USD"
});
} else {
setTimeout(fire, 50);
}
})();
</script>Add to Cart
Wire to your Add-to-Cart button's click handler:
<script>
document
.querySelector("#add-to-cart")
.addEventListener("click", function () {
window.ft.event("add_to_cart", {
item_id: "PRODUCT_ID",
value: 49.00,
currency: "USD"
});
});
</script>Email Opt-In
Fire after a newsletter / lead-magnet form submits successfully. Pass the email — FunnelTrack hashes it in-browser:
<script>
document
.querySelector("#newsletter-form")
.addEventListener("submit", function (e) {
var emailEl = e.target.querySelector('input[type="email"]');
window.ft.event("email_opt_in", {
email: emailEl ? emailEl.value : undefined
});
});
</script>3. Deploy via Google Tag Manager
Same one-liner, wrapped in a Custom HTML tag.
Create a Custom HTML tag
In GTM → Tags → New → Custom HTML. Paste the snippet that matches your event, swapping any literal values for {{ Data Layer Variable }} references where useful.
<script>
if (window.ft && window.ft.event) {
window.ft.event("add_to_cart", {
item_id: {{ DLV - product_id }},
value: {{ DLV - product_value }},
currency: "USD"
});
}
</script>Pick a trigger
Use whatever trigger fits the moment — a click trigger for Add to Cart, a form-submit trigger for Email Opt-In, a page-view trigger for Item View. FunnelTrack uses the pixel session that's already loaded on the page, so the event will be tied to the right visitor regardless of which trigger fired it.
1000) and leave custom event tags at the default. For click / submit triggers it doesn't matter — the pixel has plenty of time to load before the user interacts.4. Route the event to your ad platforms
Map each event name once, then it fans out automatically.
In FunnelTrack, open Integrations→ the destination you want (Meta CAPI, Google Ads, GA4, etc.) → choose Pixel Custom Events as the source.
Click Add Event, type the exact event name you used in your pixel call (for example, add_to_cart), and pick the destination standard event you want it to map to (Meta's AddToCart, Google Ads' add_to_cart, etc.). Save. Done.
add_to_cart from your site can fan out to Meta, Google Ads, GA4, and TikTok in one webhook trip — each platform gets the appropriate standard event name and the value / currency you passed in.Reference
Every parameter the pixel accepts.
User-data fields (hashed client-side)
These fields are SHA-256 hashed in the browser before the event leaves the page. Normalization rules match the major ad platforms' advanced matching specs.
| Field | How it's normalized before hashing |
|---|---|
email | Lowercased and trimmed |
phone | All non-digit characters stripped (E.164 sans +) |
first_name | Lowercased and trimmed |
last_name | Lowercased and trimmed |
city | Lowercased, all whitespace stripped |
region | Lowercased and trimmed. 2-letter state / region code recommended (e.g. 'ca' for California). |
zip | Lowercased and trimmed. First 5 digits recommended for US zips. |
country | Lowercased and trimmed. 2-letter ISO code (e.g. 'us'). |
Standard event properties
Anything you pass that isn't a user-data field becomes an event property. These names match destination platforms' conventions so they map cleanly:
| Property | Description |
|---|---|
value | Numeric value (e.g. 49.00). Forwarded to revenue-capable destinations. |
currency | ISO-4217 currency code (e.g. USD). |
item_id | Product / SKU identifier. Optional. |
item_name | Human-readable product name. Optional. |
| Any other key | Stored as a custom property on the event and available for filtering and mapping. |
Things to know
- •Event name can be any string. Use
snake_casefor consistency. Match the name exactly when you map it on each destination. - •Hashing is client-side. Every user-data field — email, phone, names, geo — is SHA-256 hashed in the browser before the event leaves the page. Raw values never touch FunnelTrack servers.
- •HTTPS required for hashing. On
http://the event still fires, but user-data fields are dropped. Move your site to HTTPS for full identity matching. - •Pixel session does the click-ID work.You don't have to pass
gclid,fbclid, etc. — the pixel already captured them and FunnelTrack attaches them when the event dispatches. - •No deduplication needed. Custom events from the pixel are treated as web events, with the same attribution path your page views go through.