Trying to read a cookie on a different cookie domain using Google Tag Manager - cookies

My cookie domain is .mywebsite.com
I also have cookies stored on the domain www.mywebsite.com
I am trying to get Google Tag Manager to "read" a cookie on "www.mywebsite.com" in order to pass to Google Analytics.
Is this possible?
Using the cookie variable, GTM is not able to read the cookie name.

If the cookie has the http-only attribute, you can't read it using JavaScript and/or GTM.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies?retiredLocale=de

Related

How to extract Cookie Data in JMeter

I am new to JMeter and creating JMeter scripts on .Net Framework version 4.5.
I am facing a challenge or issue that how to extract/capture values like .ASPXAuth, AuthToken, Sesson ID generating on login into web application as Cookie Data but unable to use the same in the subsequent requests as there is no parameter available in Requests.
Actually, I need to extract the cookie data value from response header and to use it further in the subsequent requests. Please share the steps to do the same.
If you need to add cookies support to your JMeter script just add a HTTP Cookie Manager to your test plan.
The HTTP Cookie Manager automatically extracts the cookies from the Set-Cookie response header, checks their validity and adds them to the next request if domain and path of the HTTP Request samplers match the Cookie's domain and path.
So in the majority of cases it's sufficient to just add the HTTP Cookie Manager in order to get browser-like behaviour when it comes to cookies handling.
If you need to use the values of the cookies somewhere else, i.e. in a request parameter you can add the next line to user.properties file:
CookieManager.save.cookies=true
upon JMeter restart the incoming cookies values will be stored as JMeter Variables so you will be able to access the value of .ASPXAuth cookie as ${COOKIE_.ASPXAuth}, the value of AuthToken cookie as ${COOKIE_AuthToken}, etc.
More information: HTTP Cookie Manager Advanced Usage - A Guide

Getting user cookies from apps script

Is there an alternative to this javascript:
document.cookie
which can be run inside apps script?
Context:
I'm using Google Analytics Measurement Protocol and is trying to collect __utmz cookie values from inside apps script functions to apply them to:
UrlFetchApp.fetch('https://www.google-analytics.com/collect...............') requests.
That __utmz cookie is being assigned at http://chrome.google.com/webstore/detail/.... page.
You don't need cookies: If users click a link from domain A to domain B you should add the _ga parameter that you get from linkerParam to the link. Then on domain B you should set allowLinker to true for GA to read the value of the _ga parameter and use it to identify the user as being the same as on domain A.

Should there be multiple _ga tracking cookies for a gtm UA tracked property containing multiple subdomains?

If example.com contains multiple subdomains and all of it resides in a single UA property, assuming subdomain tracking is properly set up in gtm (IE cookieDomain is set to auto and the root domain is on the referral exclusion list for google analytics), should more than one _ga cookie exist on page load when visiting subdomains?
For example, my gtm snippet is included across all subdomains and it fires a pageview UA tag properly and I visit status.example.com, should I see a _ga cookie with an example value of GA1.3.605803990.1475857272 with the status.example.com domain scope and a _ga cookie with an example value of GA1.2.1926999794.1476293458 with the example.com domain scope?
Or should there always be one _ga cookie fixed at just the root domain? I'm trying to determine why my google analytics is still reporting self referrals for both my root domain and subdomain.
If you want to track your domain and subdomains within a single property there should be a single _ga cookie. To make sure there is just one cookie the cookie domain should be set to "auto" when you create the tracker
ga('create','UA-XXXXXXX-X','auto');
which will make sure the cookie is set at the highest possible 'level'. If you get the code from the GA property settings the "auto" setting should already be in there, if you create the tracker via Google Tag Manager you need to explicitly set this via the "set fields" option where you set the field name to "cookieDomain" (GTM has an autosuggest feature that will help with the field names) and the value to "auto".

Google Analytics _ga cookie empty

I found out that for some users of my website the _ga (client id) cookie is empty while I really need it in my script for 100% of users.
I found this out by logging what's happening in my PHP script. This is strange to me, because for me the _ga cookie is always present, no matter which browser I use.
1) Why can the _ga cookie be empty?
2) Is there any way to force creating it? Or maybe there is another way to find out the client id of the user on the server-side?
If javascript or cookies are disabled on client browser cookies always will be empty. You can implement additional logic on server to form an id from IP and/or User-Agent header of request if cookies are empty.

Reading secure cookie in ColdFusion

I have a cookie that is being set by Microsoft ISA. I want to check that the cookie exists from ColdFusion, but the cookie isn't listed in the cookie scope. The page I'm trying to read the cookie value from is using HTTPS. Why can't I read the cookie? All the non-secure cookies are listed in the cookie scope.
If the domain value of the cookie was set by another domain then it can't be read by your web application.
It would be a security breach if www.attackerwebsite.com could read session cookies from www.yourbank.com.
I think I've found the problem. The cookie is created by the ISA server as httpOnly. Does that mean the only way to access the cookie is from the server it was created on?
The definitive answer: the ISA server sits between the client and the web server, and it grabs the cookie and doesn't let go. I can access the cookie through ColdFusion from any machine on the domain that is not behind the ISA server. So the solution I came up with was to get the cookie value through an JSONP AJAX call to another machine in the domain.