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

Remove Universal Analytics #322

Merged
merged 139 commits into from
Mar 4, 2024
Merged

Remove Universal Analytics #322

merged 139 commits into from
Mar 4, 2024

Conversation

martynmjones
Copy link
Contributor

@martynmjones martynmjones commented Oct 30, 2023

Changes proposed in this Pull Request:

Closes #215

Checks:

  • Does your code follow the WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changelog entry

Remove - Universal Analytics integration

martynmjones and others added 3 commits February 27, 2024 17:11
Deny all for EEA visitors. Document the customization snippet.
to cover the quirks of wcgaiData not being loaded otherwise.
@tomalec tomalec mentioned this pull request Feb 27, 2024
2 tasks
@tomalec
Copy link
Member

tomalec commented Feb 27, 2024

I found an issue that when you add (in a snippet or another extension) another script that has a dependency on woocommerce-google-analytics-integration and enqueue it not in the footer, for some reason the inline script with wcgaiData is not rendered, breaking the functionality.

Steps to reproduce

  1. Add a snippet:
add_action( 'wp_enqueue_scripts', function () {
    wp_register_script( 'my-code', '', array('woocommerce-google-analytics-integration'), null, false );
    wp_add_inline_script( 'my-code', "console.log('Hello');" );
    wp_enqueue_script( 'my-code' );
} );
  1. open shop page

tomalec and others added 3 commits February 28, 2024 20:33
not to let it register its `gtag` function so that we could provide a more detailed configuration.

Co-authored-by: martynmjones <[email protected]>
Set up tracker synchronously once the script is loaded (possibly in the `<head>`).
Track classic WC events only after data is ready and the document is loaded - at leas on `wp_footer`.

Address #322 (comment)
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.

Universal Analytics will stop processing data on July 1, 2023
2 participants