Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FEC-11195): Google Analytics 4 support #55

Merged
merged 6 commits into from
Jun 20, 2021
Merged

feat(FEC-11195): Google Analytics 4 support #55

merged 6 commits into from
Jun 20, 2021

Conversation

yairans
Copy link
Contributor

@yairans yairans commented Jun 17, 2021

Description of the Changes

Add support to send analytics to both Universal Analytics and Google Analytics 4 or to one of them

Solves FEC-11195

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

@yairans yairans requested a review from a team June 17, 2021 12:02
@yairans yairans self-assigned this Jun 17, 2021
@@ -92,15 +92,17 @@ export default class GoogleAnalytics extends BasePlugin {
*/
_init(): void {
if (!window.google_tag_manager) {
Utils.Dom.loadScriptAsync(`${GoogleAnalytics.GTAG_LIB_URL}?id=${this.config.trackingId}`).then(() => {
Utils.Dom.loadScriptAsync(`${GoogleAnalytics.GTAG_LIB_URL}?id=${this.config.trackingId || this.config.trackingGA4Id}`).then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

If both are configured is it ok to send only the old tracking id and not the GA4?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yairans yairans closed this Jun 20, 2021
@yairans yairans reopened this Jun 20, 2021
@yairans yairans merged commit 4ec0b8b into master Jun 20, 2021
@yairans yairans deleted the FEC-11195 branch June 20, 2021 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants