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

gtag.js #2

Closed
josebedoya opened this issue Aug 23, 2019 · 3 comments
Closed

gtag.js #2

josebedoya opened this issue Aug 23, 2019 · 3 comments

Comments

@josebedoya
Copy link

Is it work with gtag.js? analytics.js is the old way to track your website

@gmrchk
Copy link
Member

gmrchk commented Sep 16, 2019

Hi, thanks for reporting!

I'm actually not sure. Here's the code plugin executes. Does gtag.js create global window.ga object as well?

@bigskillet
Copy link

I'd like to know if this works with gtag.js as well, but I'm not sure if it creates a window.ga object. Here's what the script looks like:

<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-XXXXX-Y');
</script>

It's using gtag rather than ga.

@gmrchk
Copy link
Member

gmrchk commented Feb 25, 2020

Then I guess this plugin won't work, but the code the plugin uses can easily be used for making the gtag work too. Here's some documentation on that.

We can also create another plugin for gtag (it would need to accept the GA_MEASUREMENT_ID in options), but I won't get to that. If you'd like to pitch in, feel free to create it and we can move it under swup org.

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

No branches or pull requests

3 participants