revolunet / angular-google-analytics

Google Analytics tracking for your AngularJS apps
MIT License
652 stars 179 forks source link

GA Analytics does not working in iframe #233

Closed avtaniket closed 3 years ago

avtaniket commented 3 years ago

I have website "https://www.customer-name.our-website.com" which we adds in customers websites ""https://www.customer-website.com"" as iframe so that its easy integration for them.

GA analytics of our site isn't working as cookie are not set, not sure why? we have set cookie settings as "secure"

Note : Cross domain Cookies doesn't works in Mac - Safari, Windows - Chrome and Andriod - chrome only other browsers working

Doesn't cross domain cookie works??

jsandeepm commented 3 years ago

Hi

I have website "https://www.customer-name.our-website.com" which we adds in customers websites ""https://www.customer-website.com"" as iframe so that its easy integration for them.

GA analytics of our site isn't working as cookie are not set, not sure why? we have set cookie settings as "secure"

Note : Cross domain Cookies doesn't works in Mac - Safari, Windows - Chrome and Andriod - chrome only other browsers working

Doesn't cross domain cookie works??

Hi You can use the below settings. I tried it and its working.

fields: { 'cookieFlags': 'SameSite=None; Secure' }

image

avtaniket commented 3 years ago

Yes right, https://www.simoahava.com/analytics/cookieflags-field-google-analytics/

Currently using AnalyticsProvider.setCookieConfig({'cookieFlags': 'SameSite=None; Secure'});