79166079

Date: 2024-11-07 10:53:01
Score: 0.5
Natty:
Report link

Currently, other than appending the Google Analytics code to the affiliate.example.com/example_page.html page, for tracking to work you should also set the SameSite=None attribute for the GA cookies (if this is acceptable to you). One way to achieve it is by using cookie_flags configuration option in gtag inside an iframe:

gtag('config', 'G-N2A3FMNDT5', {
  cookie_flags: 'max-age=7200;secure;samesite=none'
});

Otherwise, the events will not be sent from the iframe.

More details about this solution can be found in this article: https://www.simoahava.com/analytics/cookieflags-field-google-analytics/

Reasons:
  • Blacklisted phrase (1): this article
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jakub Knapik