If you are not into coding, you don’t need to worry about gtag.js. It claims to bring in simpler deployment for website owners and better Google Products integration (such as Google Adwords Tracking). Event tracking lets you monitor just about any action on your site that doesn’t trigger a new page to load, giving invaluable data for improving your site.

Event tracking is one of the most useful features in Google Analytics. Event Tracking for Mailto, Telephone & PDF Hyperlinks. There is an interesting (better say ridiculous) discussion going on in the blogosphere where many ‘experts’ are comparing gtag.js with Google Tag Manager. or any other type of tracking is going to be different when you are using gtag.js.If you are setting up a brand new Google Analytics account then you have no choice but to use the Global Site Tag.If you already have a Google Analytics account with all the tracking set up then you can continue to use your existing tracking setup for the foreseeable future.Google almost always maintains backward compatibility. You will most probably hire a GA developer and they can deal with this new headache called ‘gtag.js’ : )"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own." Just because gtag.js can send the same event data to multiple GA properties or Google products does not make it a substitute for GTM, not even remotely. Copyright © 2020 OptimizeSmart.com All rights reserved. I placed the analytics code on the iframe. A few months ago, Google released a new Javascript library, named gtag.js to replace it’s already 7 years old analytics.js. to remain lightweight. This has also been done to maintain backward compatibility. This could be a lack of knowledge of the GA development environment, or the blind leading the blind, or something else. I am not exactly sure, how they came up to this conclusion. I will explain these events in more detail in another article.You can use the event command to send event data to a single GA property or group of GA properties.Following is the example of code to send event data to a single GA property:Following is the example of code to send same event data to multiple GA properties:Following is the example of code to send same event data to multiple GA groups:Here, ‘group_1’ and ‘group_2’ are non-default groups.You can also use the same ‘event’ command to track conversions in Google Adwords. The command queue function for gtag.js is ‘gtag()’ and it uses a different set of commands.

library which is used to measure users’ interactions with your website and send them to Google Analytics Server. library which is used to measure users interactions with your mobile apps via Firebase library which is used for Google Adwords Conversion Tracking.The purpose of gtag.js seems to be, to replace all of these libraries with one single library and hence gtag.js is being promoted as ‘In order to keep the size of gtag.js small, this library calls other libraries internally. He has over 12 years of experience in digital analytics and digital marketing. Following is the syntax for using the ‘event’ command:.

全局网站代码 (gtag.js) 是一种 JavaScript 代码植入框架兼 API,可让您将事件数据发送到 Google Analytics(分析)、Google Ads 和 Google Marketing Platform。本页介绍了如何使用 gtag.js 为 Google Analytics(分析)配置网站。

gtag.js Event Tracking in Google Analytics with JQuery The latest version is gtag.js. Note: How the ‘send_to’ parameter is used here to send event data to another Google product called ‘Google Adwords’. I think sooner or later, gtm.js library will also be replaced by gtag.js and we will be using the global site tag to install Google Tag Manager.Overall, Google is going in the right direction by reducing the number of tracking libraries to learn and remember.However, bear in mind that the advent of gtag.js is important for GA developers & not for end-users. The ‘config’ command configures the GA property with the tracking ID as the command and also automatically sends ‘pageview’ hit to the default property.For example the following line of code automatically sends pageview hit to the GA property ‘UA-1234567-89’:You don’t need to create a tracking object before you can send the pageview hit. Then came Google Tag Manager and solved a variety of issues when it comes to tracking common methods of interaction – great news to many of us. For a start, gtag.js does not come with a user interface like GTM. gtag.js does not work for non-Google products and I doubt, it ever will. So your existing tracking is not going to break, even if you choose not to use gtag.jsThe gtag.js is currently (at the time of writing this) in Beta and as such isn’t covered by an SLA (Service Level Agreement).The downside of sticking to analytics.js is that you will not be able to take advantage of the more powerful event tracking methods mentioned in this article, which are available only in gtag.jsAlso, Google has repeatedly mentioned in its documentation that by using gtag.js, “This is a strong hint that in the near future Google is going to introduce new features that are available only in gtag.js and not necessarily in analytics.js.

If you have used multiple tracking objects in the past, you understand how cumbersome it is, to deal with them.If you want to send the same pageview hit via analytics.js, then you would first need to create a new tracking object for each GA property via the ‘create’ command and then send pageview hit separately via the ‘send’ command:The ‘config’ command can also be used to configure a Google Adwords account with the Adwords ID to receive data sent by the For example the following line of code configure a Google Adwords account with the Adwords ID: 957488885In case of Google Adwords, the global site tag is used to add your website visitors to your basic remarketing lists and to set new cookies on your domain, which will store information about the ad click that brought a user to your website. [pluginName:] [methodName] is called Here, ‘ga’ is the command queue function and ‘create’ and ‘send’ are commands.We use the command queue function to measure/track any type of user interactions on a website.