I have been trying to set utag_main_pn and utag_main_sn cookie parameters to custom dimensions in GA but it seems not working.
I have created a first party cookie data source and name it utag_main_pn, then I have created a UDO variable with the JS code b["cp.utag_main_pn"]. Then, mapped this UDO variable to a custom dimensions I have created in GA but it seems not working.
What am I doing wrong?
Thank you very much for your support.
Solved! Go to Solution.
Without knowing more details I can't answer fully but I suspect that it has something to do with how the cookie is being generated. Are you using the Persist Data extension? Here is a reference to an article regarding the Persist Data extension:
Is your cookie value being stored within the utag_main cookie or outside? If outside perhaps that is the issue.
This is a case where we would need to look under the hood to help you investigate. Please reach out to your account manager for help to review your implementation.
No I am using a normal Set Value extension and not a Persistent one. I am storing the cookie within the utag_main. I have also checked the cookie on the page and it contains the value I am looking for. I have tried to combine this value with a GA generated cookie and the GA is parsed correctly and the pn value returns as undefined.
This is the reason why I think it has something to do with when the cookie is generated and might be that the value is mapped before being generated.
Might this be a reason for you? If yes how do I make sure the data source is created before the value is mapped to the dimension?
So I think you might be over complicating this.
Once you have created the CP Data source:
You can just map that straight to the GA Tag
This will then send the utag_main__pn value out:
Hope this helps,
Hi @adrian_browning ,
Thank you very much for your answer and I can see why you say that and that's the same feeling I had but this is not working either.
Any other ideas?
Loading the parameter from the console with the syntax utag.loader.RC("utag_main")._pn it returns the correct value. How do I place this value in a CD?
I have fixed the issue creating a set value extension with js code utag.loader.RC("utag_main")._pn and then mapped it with the CD into the tag.
thank you for your help.
@defelicemattia Thank you for sharing your solution!