Needs review
Project:
Google Analytics
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2020 at 00:22 UTC
Updated:
4 Dec 2025 at 07:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
crystalgrafix commentedHi, I tried adding this value under 'Advanced Settings'-> 'Create only fields'. However it says cookieFlags is not a valid property. Please let me know if there is a different method to add cookieFlags.
Comment #3
rot3r1any update?
Comment #4
code-drupal commentedOn save of config, it gives following error message
Create only field name cookieFlags is an unknown field name.
Comment #5
hubbs commentedI'm having the same issue.
I try to set
cookieFlags|secure;samesite=nonein "Advanced Settings > Custom Javascript Code > Parameters", but I get this error: Parameter name cookieFlags is unknown. Parameters are case sensitive. Please see documentation for supported parameters.In D7 this error doesn't happen.
Comment #6
michael_garofalo commentedI am also getting the same error message as Hubbs when trying to perform the same action. Is there any update on if a similar patch to https://www.drupal.org/project/google_analytics/issues/3238348 ?
Would be ideal to have the cookieFlags and cookieUpdate added to the parameters.
Comment #7
dmorgan42 commentedI think this should be marked as a bug fix rather than a feature request, since it appears to break ADFS (Active Directory Federation Services - e.g. SSO) logins in our organization when a GA cookie is set without the appropriate SameSite, Secure cookies set.
Comment #9
pr-lacity commentedI have created a patch that allows the
cookieFlagsandcookie_flagsto be added to the Custom Javascript Code section under Advanced Settings.Example parameters:
cookie_flags|secureThis patch works on both 8.x-3.1 and 4.0.2.
Comment #10
japerryWith the sunset of legacy google analytics, the 8.x-3.x module is now unsupported. If this is still an issue with the 4.x version, please file a new issue in the queue.
Comment #11
plopescThis is still a thing in 4.0.3.
Patch from #9 helped us to define the
cookie_flagsComment #12
plopesc