# Click ID Usage

> Learn how to generate, capture, and use the AnyTrack Click ID (atclid) for accurate conversion tracking and attribution modeling with custom integrations and webhooks.

## Overview

Custom platforms don't automatically send attribution data. When conversions happen in your proprietary CRM, custom checkout system, or any platform outside AnyTrack's 300+ integrations, attribution breaks—Facebook sees zero conversions from ads driving real sales, Google stops optimizing campaigns that actually work, and ROAS calculations become guesswork.

The AnyTrack Click ID (`atclid`) solves this. Capture it when visitors land on your site, attach it to customer records in your system, then include it when sending conversion webhooks to AnyTrack. That identifier connects the CRM sale back to the Facebook ad that started the journey — restoring attribution accuracy and feeding ad platforms the conversion signals they need.

### What is the AnyTrack Click ID (`atclid`)?

The `atclid` is a unique identifier generated by the AnyTrack Tracking Tag when a visitor clicks on your ads and lands on your website. This ID is essential for:

* **Conversion tracking**: Linking sales and leads back to specific ad clicks
* **Attribution modeling**: Understanding which ads drive the best results
* **Campaign optimization**: Providing accurate data to improve ad performance

## How to Generate, Retrieve, and Use `atclid`

### Step 1: Generate the `atclid`

The `atclid` is automatically generated by the AnyTrack Tracking Tag installed on your website. To see how this works, navigate to any webpage where the AnyTrack Tag is installed and run this code in your browser's console:

```javascript
var atclid = AnyTrack('atclid');
console.log(atclid);
```

<Image align="center" alt="The click id shows in the Console in the Developer Tools" border={true} caption="The click id shows in the Console in the Developer Tools" src={readmeAsset1} />

### Step 2: Capture the `atclid`

You need to capture the `atclid` so you can include it in your conversion data later. You can use Google Tag Manager (GTM) scripting or other automation tools to capture this value.

Here's an example using JavaScript to send the `atclid` to an external platform via WebHook:

```javascript
AnyTrack(function() {  
  var atclid = AnyTrack('atclid');  
  fetch("https://browserhook2.free.beeceptor.com", {  
    method: "POST",  
    headers: { "Content-Type": "application/json" },  
    body: JSON.stringify({ atclid: atclid })  
  });  
});
```

After running this code, your WebHook endpoint will receive the `atclid` value. You can use automation platforms like Zapier or Make to capture this data and include it in your conversion tracking workflow.

<Image align="center" alt="Send the atclid value to an external platform." border={true} caption="Send the atclid value to an external platform." src={readmeAsset2} />

### Step 3: Send conversion events with `atclid`

1. [Create a Custom Integration endpoint](https://youtu.be/NauS1sXJsrc?feature=shared) in your AnyTrack account
2. Send conversion events that include the captured `atclid` value
3. Include additional event attributes to improve attribution modeling and ad optimization

For better conversion tracking results, include as many relevant event attributes as possible. This helps train ad platform algorithms and improves targeting effectiveness. Check our [list of supported event attributes](/docs/event-attributes).

<Image align="center" alt="The events log of the Custom Integration shows the events received and their atclid." border={true} caption="The events log of the Custom Integration shows the events received and their atclid." src={readmeAsset3} />

## Troubleshooting: "No Matches Found" Error

If you see "**No match(es) found**" or "**Missing click_id**" errors in your Events Log, it means the `atclid` value wasn't included in your conversion data.

### Why this error occurs:

* The conversion data sent to AnyTrack doesn't include the required `atclid`
* Without the Click ID, AnyTrack cannot link the conversion to a specific website visitor
* The system cannot determine which ad generated the conversion
* The conversion event cannot be processed for attribution modeling

<Image align="center" alt="The Events Log shows an error if no clickId value is present." border={true} caption="The Events Log shows an error if no clickId value is present." src={readmeAsset4} />

### How to fix this error:

1. Verify your `atclid` capture code is working correctly
2. Ensure the `atclid` is included in all conversion event data
3. Test your WebHook integration to confirm the Click ID is being transmitted
4. Check that your automation platform (Zapier, Make, etc.) is properly forwarding the `atclid`

## Related Resources

- [Install AnyTrack Tag](/docs/install-anytrack-tag)
- [Facebook Ads](/docs/facebook-ads)
- [Event Mapping](/docs/event-mapping)

<FaqAccordion
  title="Frequently Asked Questions"
  icon="fa-duotone fa-circle-question"
  items={[
    {
      question: "Can I use any Click ID in the conversion data I send to AnyTrack?",
      answer: "No. Use the specific atclid value generated by the actual visitor on your website. Using a different or incorrect Click ID causes attribution errors or links the conversion to the wrong user. The atclid must match the visitor who generated the conversion event."
    },
    {
      question: "What technology powers the AnyTrack Click ID system?",
      answer: "The AnyTrack Click ID article explains how the atclid is generated, how it stitches client-side and server-side events, and how it powers conversion tracking and attribution modeling."
    },
    {
      question: "How long is the atclid valid for conversion tracking?",
      answer: "The atclid remains valid for the duration of your attribution window settings in AnyTrack. This ensures conversions can be properly attributed even if they occur days or weeks after the initial ad click."
    },
    {
      question: "What happens if multiple people use the same device?",
      answer: "Each unique visitor session generates its own atclid, so conversions are attributed to the correct ad interaction even on shared devices."
    },
    {
      question: "Why is my hidden form field still showing --CLICK-ID-- instead of the actual Click ID?",
      answer: "The --CLICK-ID-- placeholder is replaced by AutoTag only after the AnyTrack Tracking Tag has fully loaded. If your form renders before the tag finishes loading (common with fast-loading pages or cached forms), the placeholder may not be replaced in time. To fix this, use the AnyTrack callback pattern to programmatically set the hidden field value once the tag is ready. This is more reliable than relying on the --CLICK-ID-- placeholder for hidden form fields."
    }
  ]}
/>
