Skip to content

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.

Important

This 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.

  • 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

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}}'
});

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.

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.

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": "customer@example.com",
"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.


FAQ & Troubleshooting

FAQ was last reviewed on 2026-06-10

What types of external IDs can I use?
Any unique identifier that is available both in the browser and in the platform's webhook payload. cart IDs, lead IDs, user IDs, email addresses, or cookies. The key requirement is that the same value appears in both the client-side event and the server-side webhook.
Can I use refId with any AnyTrack event type?
Yes. The refId parameter works with any event triggered via the AnyTrack Event Snippet. Common use cases include AddToCart, Lead, and custom events where the destination platform cannot accept the AnyTrack Click ID directly.
What happens if the webhook payload format does not match AnyTrack parameters?
You can remap webhook fields using an automation tool like Integromat (Make) to match the AnyTrack event attributes format before sending the data to the AnyTrack webhook endpoint.
How is this different from standard Click ID tracking?
Standard tracking passes the AnyTrack Click ID directly through forms or links. External ID tracking creates an alias between the Click ID and a third-party identifier, which is useful when the destination platform cannot store or return the AnyTrack Click ID.