Get the Google Analytics 4 Tracking Code – 15-Second Tutorial

If you’ve been pulling your hair out trying to find the tracking code in Google Analytics 4, I’m going to be your hero.

Steps to generate the tracking code for Google Analytics 4

  1. Log in to your Google Analytics and navigate to the relevant account
  2. Click “Admin” in the bottom-left corner
  3. Go to Property settings -> Data collection and modification -> Data streams
    Screenshot of the Google Analytics 4 property settings showing you where to find "Data streams", which will get us our tracking code
  4. Click on the data stream you have, or create one if you haven’t set one up yet (just follow the prompts)
    Screenshot of the Google Analytics 4 admin interface, showing all data streams and leading to the tracking code
  5. Scroll down to “View tag instructions” and click it
    Screenshot of the Google Analytics 4 admin interface where we can click through to View tag instructions, which is where the tracking code is hidden
  6. Click “Install manually” and copy your tracking code to use wherever you like.
    Screenshot of the admin interface of Google Analytics 4, showing the "Install manually" tab and showing the actual tracking code you wish to embed

That’s it! There’s your tracking code.

Now I can’t be the only one that was driven completely mad the first time I had to install Google Analytics 4 for someone, simply trying to find the most basic element: the tracking code.

Coming from a decade of working with the older versions of Google Analytics where it was always extremely obvious where to find the code, it was really quite baffling.

Even more baffling, Google searches for “where is the tracking code in Google Analytics 4” and related searches yielded absolutely nothing useful.

Instead, I was bombarded by 30-minute “quick start” guides for GA4 which somehow didn’t even seem to mention this most-fundamental component.

I may never get an answer as to why any of these things are the way they are, but you now have the tracking code you seek, and it’s not even difficult to get to.

You’re welcome.

About Brian Johnson

Brian Johnson is a website developer and designer living in Minneapolis, Minnesota with a passion for code and WordPress. He spends his days building WordPress websites for small businesses, developing new code with the online community, and living life.

Leave a Reply

Your email address will not be published. Required fields are marked *