middleman-google-analytics icon indicating copy to clipboard operation
middleman-google-analytics copied to clipboard

Replace analytics.js with gtag.js

Open mojavelinux opened this issue 7 years ago • 2 comments

Google is now recommending that all new sites adopt the gtag.js script instead of analytics.js.

gtag.js is the web tagging library that works for Google's site measurement, conversion tracking, and remarketing products – giving you better control while making implementation easier. By using gtag.js, you will be able to benefit from the latest dynamic features and integrations as they become available.

The gtag.js script merges the functionality of Google Tag Manager and Google Analytics into one and fixes some cross domain cookie issues, as far as I understand it.

This issue is to request for this extension to use gtag.js instead of analytics.js, or offer an option to enable it.

For details, see:

  • https://developers.google.com/analytics/devguides/collection/gtagjs/migration
  • https://support.google.com/analytics/answer/7538414

mojavelinux avatar Feb 06 '18 06:02 mojavelinux

Thank you for your request 💛 If gtag.js is the new recommended variant, then we should replace analytics.js. I would be happy about a PR.

danielbayerlein avatar Feb 06 '18 19:02 danielbayerlein

Already done it. https://github.com/danielbayerlein/middleman-google-analytics/pull/33

I think it's too premature to switch from analytics.js because not everyone is convinced about the transition yet. So there were be a period we should probably support both.

mojavelinux avatar Feb 06 '18 20:02 mojavelinux