PageView and Click ID
Learn how AnyTrack tracks page views automatically and how to generate the atclid Click ID variable for use in forms, links, or CRM integrations. Covers the atclid command, callback syntax, Google Tag Manager setup, and the atclidToUrl method for appending the Click ID to page URLs.
PageView events track every page load, building a complete picture of the customer journey. The AnyTrack Tag automatically captures page views and enriches them with UTM parameters, traffic source, and session data. Ad platforms use this journey data to understand what content and messaging drives conversions.
Technical implementation requiredThe
atclidandatclidToUrlcommands below require JavaScript knowledge. If you are not comfortable with code, share this guide with your developer.
Generate the atclid Variable
The atclid command returns a Click ID generated from the current user session, without relating it to any specific event. Use this when you need the Click ID value for custom integrations:
var atclid = AnyTrack('atclid');This command only works after the AnyTrack Tag has loaded. To ensure the Tag is ready, wrap the call in a callback:
AnyTrack(function () {
var atclid = AnyTrack('atclid');
// Use atclid value here
});Generate atclid in Google Tag Manager
Create a Custom JavaScript Variable in GTM with the following code:
function () {
return AnyTrack('atclid');
}The atclid value is then available as a variable in any tag within your GTM container.
Append Click ID to Page URL
For form builders that cannot support hidden fields but can read URL parameters, use the atclidToUrl command to append the Click ID to the page URL:
<script>
AnyTrack(function() {
AnyTrack('atclidToUrl', 'custom_query_parameter');
});
</script>Replace custom_query_parameter with the parameter name your form expects. The default parameter name is _atid if no custom name is provided.
For a complete guide on URL-based Click ID passing, see Single Page Tracking.
Frequently Asked Questions
FAQ was last reviewed on 2026-02-18
Updated 1 day ago
