Analytics
5.1K members online now
5.1K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Analytics Cookie with Secure Flag On

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Is it possible to force the Google Analytics script to set the secure flag on its cookies?
https://en.wikipedia.org/wiki/HTTP_cookie#Secure_cookie

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Eric H
May 2016

Re: Analytics Cookie with Secure Flag On

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
I never found a way to turn on the SECURE flag on the cookie. However, moving the tracking ID from a cookie to localStorage solved my problem.

https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#using_local...

View solution in original post

Re: Analytics Cookie with Secure Flag On

[ Edited ]
Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Seems like Google may not want us to secure our cookies?
http://stackoverflow.com/questions/9094026/secure-google-tracking-cookies

Also, Someone here has hacked it, by changing the flag after the cookies are created. I have no idea if this would have adverse effects on tracking.
https://community.qualys.com/thread/12173

Marked as Best Answer.
Solution
Accepted by topic author Eric H
May 2016

Re: Analytics Cookie with Secure Flag On

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
I never found a way to turn on the SECURE flag on the cookie. However, moving the tracking ID from a cookie to localStorage solved my problem.

https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#using_local...