External ID as Click ID
Learn how to use an external identifier from a third-party platform as the AnyTrack Click ID to track server-side conversions. Covers the refId parameter, how aliasing works, and a step-by-step setup guide for connecting external platform data with AnyTrack attribution using custom integrations and webhooks.
AnyTrack allows you to use an external identifier instead of the AnyTrack Click ID to track server-side conversions. The refId parameter aliases any third-party value — a cart ID, lead ID, or user ID — with the AnyTrack Click ID, so conversions can be matched even when the external platform cannot store custom parameters.
Technical implementation requiredThis guide requires JavaScript skills or the ability to use Google Tag Manager to capture variables, cookies, or event data from the browser. If you are not comfortable with code, share this article with your developer.
When to Use External IDs
- The platform where conversions happen does not accept custom parameters like the AnyTrack Click ID
- You cannot modify forms, or forms are generated programmatically via JavaScript
- The platform's webhooks do not include custom fields
How It Works
The refId parameter creates an alias between the AnyTrack Click ID and an external identifier. When a conversion event arrives via webhook, AnyTrack uses the alias to match it back to the original session.
Standard flow (Click ID available):
During the AddToCart event, AnyTrack passes the Click ID to the cart object. During the Purchase event, the platform returns the same Click ID in the webhook payload:
AnyTrack('trigger', 'AddToCart', {
customId: 'e.clickId',
cartId: '{{cartId}}',
value: '{{cartValue}}',
currency: '{{currency}}',
items: [{
id: '{{skuId}}',
price: '{{price}}',
quantity: '{{quantity}}',
name: '{{itemName}}'
}],
token: '{{cartToken}}'
});External ID flow (Click ID not available):
During the AddToCart event, AnyTrack records the Click ID and aliases it with the cartId using the refId parameter:
click_id = refId = cartId
When the platform sends a webhook with the cartId, AnyTrack resolves the alias and ties the conversion back to the original Click ID:
AnyTrack('trigger', 'AddToCart', {
refId: '{{cartId}}',
cartId: '{{cartId}}',
value: '{{cartValue}}',
currency: '{{currency}}',
brand: '{{itemName}}',
items: [{
id: '{{skuId}}',
price: '{{price}}',
quantity: '{{quantity}}',
name: '{{itemName}}'
}],
token: '{{cartToken}}'
});Setup Guide
Step 1: Trigger an Event with refId
Fire an event using the AnyTrack Event Snippet and include the refId parameter with the external identifier value:
AnyTrack('trigger', 'AddToCart', {
refId: '12831238',
cartId: '12831238',
value: '200',
currency: 'USD',
items: [{
id: '111',
price: 200,
quantity: 1,
name: 'Tesla'
}],
token: 'asdasdjkasdj'
});When this snippet executes, AnyTrack automatically aliases the Click ID with the refId value. The alias is stored server-side and used to match incoming webhook conversions.
Step 2: Create a Custom Integration
Navigate to the integration catalog and create a custom integration. The system issues a webhook URL:
https://t1.anytrack.io/GqxV3nTo/collect/custom-test
Depending on how the third-party system formats its webhook payload, you may need to remap parameters to match the AnyTrack event attributes format.
Step 3: Send the Conversion via Webhook
When the conversion happens, the platform sends a webhook containing the external ID. The refId in the payload matches the alias created in Step 1:
{
"`event_name`": "Purchase",
"email": "[email protected]",
"refId": "12831238",
"fullName": "John Doe",
"phone": "+1234567890",
"country": "US",
"items": [{
"id": "111",
"price": 200.00,
"quantity": 1,
"name": "Product Name"
}],
"currency": "USD",
"id": "24356562534585",
"subtotalprice": 200.00,
"totalprice": 200.00,
"taxPrice": 10.00,
"value": 200.00,
"transactionId": "#24356562534585"
}AnyTrack resolves the refId, connects it to the original Click ID, and forwards the conversion to all connected ad platforms via Conversion API.
Frequently Asked Questions
FAQ was last reviewed on 2026-02-20
Updated about 3 hours ago
