How to setup GA4 in WordPress and Joomla Websites

Channel Digital

Written by Joe Frost on .

User Rating:  / 0
PoorBest 

Below is a comprehensive guide on how to setup Google Analytics 4 on your WordPress and Joomla websites.  

If you set this up to run alongside your existing Universal Analytics account, you will need to opt our of the automatic upgrade that google is planning to do on February 28th.  To opt out you need to:

  1. Go to your Google Analytics account, click on Admin
  2. Under the Property column click on GA4 Setup Assistant
  3. Under ‘Automatically set up a basic Google Analytics 4 property’ click on the toggle button to turn off.
  4. Repeat this for any other views you have set up in your account.

Read more about the pros and cons of opting out here.  

GA4 Setup

  1. Login to Google Analytics and select your account property
  2. Click on Admin
  3. GA4 setup

  4. Select account if not already selected (or create new account if it doesn’t exist)
  5. Create a new property
  6. Create GA4 account

  7. Add your property name (we normally use the domain name without https or www - eg “your-website.com” but any descriptive name will do)
  8. GA4 setup on your website

  9. Select appropriate options and click on Create
  10. GA4 create account

  11. Select relevant data streams. In this example we are using ‘Web’
  12. GA4 step7

  13. Add your website URL.  Some websites use www. before and some don't, check you have the right one! 
  14. Add the Stream name - use the website address without www. here. 
  15. GA4 step8 9

  16. Make a note of your measurement ID, you will need this later
  17. GA4 measurement ID

How to add GA4 to Google Tag Manager

If you already have an account set up in Google Tag Manager, you can skip steps 1 to 3.

  1. If you do not already have an account, you can set one up here.  Add your Account Name, Container Name and choose your target platform and click on create. In this example we are using Web.  Then copy the code in the modal and save for later.  Make a note of your TAG ID and save for later.
  2. GTM Step1a

    GTM Step1b

  3. Click Add a new tag
  4. GTM Step2

  5. Tag Type: select Google Analytics GA4 Configuration
  6. Paste in the Measurement ID from Google Analytics (see list number 10 saved above)
  7. Set Triggering to “All Pages”
  8. Click Save
  9. GTM Step3 6

  10. Click Submit
  11. GTM Step7

  12. Add small description for Version Name and
  13. Click Publish
  14. GTM Step8 9

How to add Google Tag Manager tracking code to your website

WordPress website using GTM4WP plugin by Thomas Geiger

There are a few different ways of adding the tracking code to your wordpress website, either using a suitable plugin or adding the tracking code directly to your theme template.

  1. Install and activate the GTM4WP plugin.
  2. Click Settings for GTM4WP in the plugin list view.
  3. GTM Wordpress plugin instructions

  4. Enter your Google Tag Manager ID and click Save Changes
  5. GTM Wordpress plugin instructions step 2

  6. Visit the website homepage. In a separate browser window/tab go to Google analytics dashboard, select the new GA4 property in the view drop down and select reports button and Real-time to see live traffic data. Confirm you can see visitor activity after a couple of minutes.
  7. GTM Wordpress 3

Joomla website using the Google Tag Manager plugin

  1. Install: https://extensions.joomla.org/extension/google-tag-manager/. Go to Plugins / Google Tag Manager
  2. Joomla GTM plugin instructions

  3. Add GTM Container ID saved above in Google Tag Manager (item 1 TAG id). Click on Save
  4. Joomla GTM plugin instructions step 2

  5. Visit the website homepage. In a separate browser window/tab go to Google analytics dashboard, select the new GA4 property in the view drop down and select reports button and Real-time to see live traffic data. Confirm you can see visitor activity after a couple of minutes.
  6. Joomla GTM plugin instructions step 3

Every site will be unique in it's configuration and variety of plugins. Occasionally you may find a conflict with a plugin which could cause a bugs. Our recommendations use well tested plugins but if you have any issues please do contact us.

We use cookies to improve our website and your experience when using it. To find out more about the cookies we use and how to delete them, see our Privacy Policy.

I accept cookies from this site
EU Cookie Directive plugin by www.channeldigital.co.uk