Skip to content

Conversation

@gpsamson
Copy link
Contributor

@gpsamson gpsamson commented Mar 24, 2021

What does this PR do?
This pull request fixes a bug where GA4 set commands were not being passed to gtag.js with the "set" string. This wasn't caught when loaded locally because GA will swallow the errors.

Are there breaking changes in this PR?
N/A

Testing

  • Added unit tests to ensure "set" is passed
  • Testing completed successfully using a stage snippet on a non-local site

Any background context you want to provide?

Is there parity with the server-side/android/iOS integration components (if applicable)?

Does this require a new integration setting? If so, please explain how the new setting works

Links to helpful docs and other external resources

@gpsamson gpsamson requested review from brennan and briemcnally March 24, 2021 23:04

// cookie_flags uses the `set` command
analytics.equal(window.ga4DataLayer[3][0]['cookie_flags'], 'SameSite=None;Secure')
analytics.equal(window.ga4DataLayer[3][0], 'set')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use a deepEqual here like the other updated tests!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that may be cleaner. I'll change before I merge!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Definitely a nit - but it does look nice this way! Thank you!

@gpsamson gpsamson merged commit aeec1f4 into master Mar 24, 2021
@gpsamson gpsamson deleted the ga4 branch March 24, 2021 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants