PageView Click ID identifier: atclid
Learn how to generate Click IDs for offer links, form inputs, or conversions using the atclid and atclidToUrl commands.
By default, AnyTrack generates a click_id for engagements such as OutboundClicks, ViewContent, and FormSubmit. However, the standard PageView event does not trigger a click_id.
In some cases, you might want to get a click_id value out of the standard PageView event so that you can use this click_id value at a later stage of the funnel.
The PageView Click ID is usually used to set an identifier to a user.
Generate the atclid variable
The atclid variable is a Click ID generated using the current user session without relating it to any particular event. Use the following code to generate it:
var atclid = AnyTrack('atclid');Please note that this code will work only AFTER AnyTrack TAG was loaded on your page. In order to verify the code is already loaded, you can use the script:
You can also use it to further do something with it.
AnyTrack(function () {
var atclid = AnyTrack('atclid');
});How to generate the atclid value in Google Tag Manager
- Create a new Javascript Variable
- Insert the following Code and Save
Now you can use the atclid value in any of the tags within your Google Tag Manager container
function () {
return atclid = AnyTrack('atclid');
}Using atclidToUrl
atclidToUrlFor scenarios where form builders or embedded forms cannot support hidden fields, you can append the AnyTrack click ID to the page URL using the atclidToUrl command. This ensures tracking continuity by appending the click ID to the URL on load.
<script>
AnyTrack(function() {
AnyTrack('atclidToUrl', 'custom_query_parameter');
});
</script>Replace custom_query_parameter with the name your form expects. This method is useful when forms can capture values from URL parameters, enabling accurate server-side conversion tracking and attribution.
Updated 9 days ago
