Closed josebedoya closed 4 years ago
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?
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
.
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.
Is it work with gtag.js? analytics.js is the old way to track your website