
You can use the tracking TAG to generate Click IDs for offer links, form inputs or even for custom events.
However, sometimes you want to generate a Click ID without triggering any event. This is very useful if you want to store the Click ID on the user session details and use it later on.
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:
AnyTrack(function() {
var atclid = AnyTrack('atclid');
// do something with atclid...
});
How to create the atclid variable in Google Tag Manager
- Create a Javascript Variable
- Insert the following code & Save
Now you can use the atclid variable in any of the tags within your Google Tag Manager container
function() {
var atclid = AnyTrack('atclid');
return atclid;
}
Comments
0 comments
Please sign in to leave a comment.