Google introduces new analytics tag

04 October 2017
|
1 min read
|

Google has released a new way of implementing your analytics tracking.

It's called the Global Site Tag and its aim is to unify tracking across all the products currently offered by Google.

Obviously, if you want to migrate, it could be a huge transition (considering all code would need writing). If you have tons of sites and even more events, there could be hefty load of work on your plate. For the foreseeable you'll definitely be able to keep everything as it is and look to move over in the future.

With all the obvious changes you might of thought of, one particular thing of note is the way in which analytics will handle events with the new code.

For common events, you can simply pass analytics the event name like so:

gtag('event', 'login');

"login" is automatically recognised by analytics in this instance and will populate the category for you (in this example "engagement").

Of course, you are still open to customising the category and label if you so wish:

gtag('event', 'login', {
   'event_category': 'access',
   'event_label': 'Facebook'
});

As previously said, it may not be worth moving everything over to the new way of doing it. Especially if you already manage a huge web of tracking accounts.

If you're new to analytics there's no reason you shouldn't start using the new tag especially if you aren't using Tag Manager.