Tracking Clicks & Conversions with GTM and the API
Updated August 5, 2026
How tracking works
Influise uses server-side click ID tracking. Each influencer gets a redirect link ({brandSlug}.influise.com/c/{slug}) that records a click server-side and appends a unique clid to the destination URL. Tag 1 stores that ID in a cookie; Tag 2 is the importable Influise Conversion GTM Tag Template.
Set a Workspace URL in Settings — e.g.mybrand— before tracking links are generated. Your tracking links will then bemybrand.influise.com/c/their-slug.
The flow
- Influencer shares their tracking link. A visitor clicks it.
- Our server records a Click and redirects to your destination URL with
?clid={clickId}&utm_source=...appended. - GTM Tag 1 (All Page Views) reads
clidfrom the URL and stores it in a persistent cookie. - When a conversion happens, the Influise Conversion template (Tag 2, Pixel mode) reads the cookie automatically and fires a pixel to
/api/conversion. - Influise validates the click, attributes the conversion to the right influencer (and campaign if applicable), and deduplicates by
customerId.
Tag 1 — Store click ID cookie
Trigger: All Page Views · Custom HTML or GTM Template.
(function() { var clid = new URLSearchParams(window.location.search).get('clid'); if (clid) document.cookie = 'influise_clid=' + encodeURIComponent(clid) + '; path=/; max-age=31536000; SameSite=Lax'; })();
Stores the clid from the URL in a 1-year cookie. If the visitor arrives via a new tracking link their cookie is overwritten — last-click attribution. Paste into a Custom HTML tag, or download the Influise Click ID Cookie GTM template from the Integrations page.
Tag 2 — Influise Conversion (GTM Tag Template)
Trigger: your conversion event (e.g. purchase). Tag 2 uses an importable GTM Tag Template — no JavaScript to write. Download it from the Integrations page and import via GTM → Templates → Tag Templates → New → ⋮ → Import. Set Send Mode to Pixel. The influise_clid cookie is read automatically — just fill in these fields:
- Send Mode — select Pixel to send directly to Influise.
- API Key — your Influise API key, pre-filled on the Integrations page.
- Customer ID — GTM variable: a stable unique customer identifier (user ID, email, etc.).
- Conversion Value — GTM variable for order value; leave blank to use influencer default.
- Payment / Order ID — GTM variable for unique order ID; prevents double-counting in Every conversion mode.
- Endpoint URL — optional first-party proxy URL for adblocker bypass (e.g.
https://yourdomain.com/tr).
Cookie found: pixel sends clickId for standard attribution. No cookie (returning customer on a different device): falls back to customerId + paymentId lookup. Exits silently if neither is available.
Direct API (without GTM)
Standard conversion — customer arrived via a tracking link:
POST /api/conversion · X-API-Key: <your API key> · { "clickId": "<clid value>", "customerId": "<id>", "conversionValue": 500 }
Recurring or cross-device — no new click:
POST /api/conversion · X-API-Key: <your API key> · { "customerId": "<same id as first conversion>", "paymentId": "<unique payment id>", "conversionValue": 500 }
clickIdis optional — omit it for recurring payments or cross-device events. When absent, the original influencer is looked up from the customer's first recorded conversion.paymentIdis required whenclickIdis absent and Every conversion mode is enabled.conversionValueis optional — it overrides the influencer's default Value per Conversion.
Key notes
- Your API key is found on the Settings page. Keep it secret — it never needs to leave your server.
- The
influise_clidcookie persists for 1 year and is overwritten on each new tracking link visit (last-click). - Conversions outside a configured attribution window are rejected.
- Campaign-specific tracking links automatically attribute both clicks and conversions to the correct campaign.
- The Integrations page has the downloadable GTM template, HTTP API examples, and a native WordPress/WooCommerce plugin for automatic purchase and registration tracking without GTM.