I have a question about the possibility of assigning an id to a device (pc, mobile or tablet).
I would like to assign a unique device ID to a single device in order to track its path on my website. My site does not require registration and login so I cannot use the classic UserID.
I should integrate it with a variable on Google Tag Manager and then it should be written in Javascript.
Can anyone help me?
Even I guess the original
GA client idis already what you are chasing for. You can take a look about it first.But here still have the option to do your own device id:
1. You can create a Tag first in Google Tag Manager
type : Custom JavaScript
Don't add the trigger yet. We will get back to this.
2. Create a variable to get your device id cookie
3. Create the trigger back to step1's tag
4. Done
Now you have the cookie of your own device-id if the user don't have one. You can use the cookie
{{cookie_self_device_id}}in the GA4 configuration as a user property.