---
title: "Setting up gtag.js event tracking in Google Analytics"
description: "Setting up gtag.js event tracking · Check the admin section of your Google Analytics account · In “Tracking Info”, then “Tracking Code” look for “Global Site Ta"
canonical: "https://cleandigital.co.uk/blog/setting-up-gtag-js-event-tracking"
image: "https://dropinblog.net/cdn-cgi/image/fit=scale-down,format=auto,width=700/34249716/files/featured/setting_up_gtag_google_analytics.png"
content_signal: "ai-train=no, search=yes, ai-input=yes"
---

[Back to Blog](https://cleandigital.co.uk/blog)

# Setting up gtag.js event tracking in Google Analytics

By Rory Young

•

29 August 2018

2 minute read

[Analytics](https://cleandigital.co.uk/blog#topic=Analytics)

![Setting up gtag.js event tracking in Google Analytics](https://dropinblog.net/cdn-cgi/image/fit=scale-down,format=auto,width=700/34249716/files/featured/setting_up_gtag_google_analytics.png)

If your Google Analytics account is using the latest “gtag.js” snippet, and you rely on event tracking for your reporting and analysis, you may need to adapt how your event tracking is set up in your website code.

## analytics.js event tracking

On our site, we track button clicks on one of our pages. The old analytics.js code snippet event tracking naming convention was as follows:

```
onclick=”ga(‘send’, ‘event’, ‘download’, ‘casestudy’, ‘casestudy1’);”
```

## gtag.js event tracking

The new naming convention for gtag.js is:

```
onclick=”gtag(‘event’, ‘download’, {‘event_category’:’casestudy’ ,’event_label’:’casestudy1′});”
```

## Actions and Next Steps

1. Check the admin section of your Google Analytics account
2. In “Tracking Info”, then “Tracking Code” look for “Global Site Tag (gtag.js)” above your snippet.
3. If you’re not sure if you have event tracking set up, go to Behaviour, Events, Top Events in the left hand nav:

If your event activity has dropped off in the last few weeks/months, this new naming convention could be the reason.

We’re seeing this more and more at the moment, especially as Google Ads adopts gtag.js as their default conversion tracking and remarketing tag, which they have rolled out as a solution to combat Safari’s latest Intelligent Tracking Prevention (ITP) update.

Share This Article

## Related Articles

### You May Also Like

[![How To Track Campaign Performance Using UTMs](https://dropinblog.net/cdn-cgi/image/fit=scale-down,format=auto,width=700/34249716/files/featured/track_campaign_performance_using_utms.png) #### How To Track Campaign Performance Using UTMs So, the strategy is sorted, the image and video assets created, the audiences finalised, the campaigns on each platform are ready to go… but](https://cleandigital.co.uk/blog/how-to-track-campaign-performance-using-utms)

[![Compound Bidding: Looking Beyond Performance Data](https://dropinblog.net/cdn-cgi/image/fit=scale-down,format=auto,width=700/34249716/files/featured/compound_bidding.png) #### Compound Bidding: Looking Beyond Performance Data One of the single biggest factors behind under-performing PPC accounts is “compound bidding”. Below is a list of different ways adjust bids](https://cleandigital.co.uk/blog/compound-bidding-looking-beyond-performance-data)

[![How PPC Can Help Measure Your Offline Advertising Impact](https://dropinblog.net/cdn-cgi/image/fit=scale-down,format=auto,width=700/34249716/files/featured/offline_advertising.png) #### How PPC Can Help Measure Your Offline Advertising Impact TLDR: PPC is rarely a standalone channel. See how we can analyse Google Ads data to identify trends & added value from offline advertising channels.](https://cleandigital.co.uk/blog/how-ppc-can-help-measure-your-offline-advertising-impact)

```json
[
  {
    "@context": "https://schema.org",
    "@type": "BlogPosting",
    "@id": "https://cleandigital.co.uk/blog/setting-up-gtag-js-event-tracking#blogposting",
    "url": "https://cleandigital.co.uk/blog/setting-up-gtag-js-event-tracking",
    "mainEntityOfPage": {
      "@type": "WebPage",
      "@id": "https://cleandigital.co.uk/blog/setting-up-gtag-js-event-tracking"
    },
    "headline": "Setting up gtag.js event tracking in Google Analytics",
    "description": "Setting up gtag.js event tracking · Check the admin section of your Google Analytics account · In “Tracking Info”, then “Tracking Code” look for “Global Site Ta",
    "image": [
      "https://dropinblog.net/cdn-cgi/image/fit=scale-down,format=auto,width=700/34249716/files/featured/setting_up_gtag_google_analytics.png"
    ],
    "datePublished": "2018-08-29T04:26:00.000Z",
    "dateModified": "2018-08-29T04:26:00.000Z",
    "inLanguage": "en-GB",
    "author": {
      "@type": "Person",
      "name": "Rory Young"
    },
    "publisher": {
      "@type": "Organization",
      "@id": "https://cleandigital.co.uk/#organization",
      "name": "Clean Digital",
      "url": "https://cleandigital.co.uk",
      "logo": {
        "@type": "ImageObject",
        "url": "https://cleandigital.co.uk/images/logos/clean-digital/clean-digital-ppc-logo-black-transparent.png"
      }
    },
    "keywords": [
      "Google Analytics",
      "gtag.js"
    ],
    "articleSection": [
      "Analytics"
    ]
  },
  {
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "@id": "https://cleandigital.co.uk/blog/setting-up-gtag-js-event-tracking#breadcrumb",
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "name": "Home",
        "item": "https://cleandigital.co.uk/"
      },
      {
        "@type": "ListItem",
        "position": 2,
        "name": "Blog",
        "item": "https://cleandigital.co.uk/blog"
      },
      {
        "@type": "ListItem",
        "position": 3,
        "name": "Setting up gtag.js event tracking in Google Analytics",
        "item": "https://cleandigital.co.uk/blog/setting-up-gtag-js-event-tracking"
      }
    ]
  }
]
```
