Skip to main content

How to use next-gen GA4 analytics

Learn how to use GA4 which collects event-based data from both websites and apps designed for the future of measurement.

J
Written by James bradbury
Updated over 2 years ago

We are excited to announce our newest application with GA4 will allow the following benefits to your e-commerce site.

  • Collects both website and app data to better understand the customer journey

  • Uses event-based data instead of session-based

  • Includes privacy controls such as cookieless measurement, and behavioural and conversion modeling

  • Predictive capabilities offer guidance without complex models

  • Direct integrations to media platforms help drive actions on your website or app

To set up your store to use Google Tag Manager (GTM) by adding your Container ID in the main admin CMS please click on the button below.

Once GTM tags are added to your store, for tracking to Google Analytics, we can proceed with the final configuration of adding two GA4 tags.

1. A tag that fires on all pages.

2. A Data Layer event tag that accesses all e-commerce data and triggered by some events.

For further information on Google GA4 configuration please click the button below.

Google Tag Manager allows you to set up and manage GA4 events all in one place. To send event data from Google Tag Manager to GA4, you need two tags that work together:

  • Google Analytics: GA4 Configuration
    The GA4 Configuration tag ensures data flow from your website to Google Analytics.
    Create one configuration tag on every page where you want to collect analytics data.

  • Google Analytics: GA4 Event
    The GA4 Event tag lets you set up events on your website without writing code. The event data shows up in your GA4 reports.
    Create as many event tags as you need to measure your recommended or custom events.

For a more in-depth video tutorial on GA Analytics please refer to the below video from Google Analytics.

Step 1: Create a GA4 Configuration tag

Start by creating a Google Analytics: GA4 Configuration tag to send data to your Analytics property.

  1. In Google Tag Manager, click Tags > New.

  2. Enter a name for the tag at the top (e.g., "GA4 Configuration - example.com").

  3. In the Tag Configuration box, select Google Analytics: GA4 Configuration.

  4. Configure your tag:

    • In the field Measurement ID, enter your "G-" ID.

    • Keep the Send a page view event when this configuration loads option checked to automatically send pageview events.

  5. Optional settings:

    • Server-side tagging: Select Send to server container to send all GA4 events to a Tag Manager server container instead of Google Analytics. Specify the Server Container URL of your Tag Manager server container. Learn more about Server-Side Tagging.

    • Parameters: Add any parameters you'd like to configure in Fields to Set. Use recommended event parameter names so that Google Analytics can populate dimensions and metrics for you.

      Example 1: To set a user ID, add a row to Fields to Set. Set the Field Name to user_id, and the Value to a Tag Manager Variable that returns the user ID.

      Example 2: Use Fields to Set to configure cookie field settings:

      Parameter NameExamplecookie_prefixSubscriberCookiecookie_domaintickets.example.comcookie_expires31536000

    • Custom properties: Add any custom user properties that you'd like to configure in User Properties.
      Note: Analytics automatically collects some user dimensions so you don't have to define user properties for them. You can set up to 25 additional user properties per Google Analytics 4 property.

Step 2: Create a trigger

Next, set up a trigger to load the Google Analytics: GA4 Configuration when someone loads your website.

  1. To ensure that the Google Analytics 4 Configuration tag fires before other triggers, click Triggering and use the Initialization - All pages trigger. Learn more about Page triggers.

  2. Save the tag configuration.

Result

Your tag configuration should look like this:

Screenshot of Google Tag Manager that shows the result of the setup.

Step 3: Verify your tag works

To make sure your tag works as intended:

  1. In Google Tag Manager, click Preview. The Tag Assistant opens.

  2. Enter your site's URL.

  3. Check if the Google Analytics: GA4 Configuration fired when the page loaded.

    • βœ… If your tag fired successfully, the Tag Assistant UI look like this:

      Screenshot of the Google Tag Assistant showing a successfully configured Google tag
    • ❌ If your tag didn't fire, check your tag's trigger settings.

  4. When you are done with debugging, close Preview mode.

  5. In your Workspace, click Submit to publish your changes

Step 1: Create a GA4 Event tag

Start by creating a Google Analytics: GA4 Event tag for the new custom event.

  1. In Google Tag Manager, click Tags > New.

  2. Enter a name for the GA4 Event tag at the top (e.g., "GA4 Event - Signup newsletter").

  3. Select Google Analytics: GA4 Event.

  4. In Configuration Tag, select your Google Analytics: GA4 Configuration tag.

  5. In Event Name, enter a name for the event (e.g. signup_newsletter). This will create a new custom event and the name will appear in your GA4 reports. To create a recommended event, use one of the predefined event names.

Step 2: Create a trigger

Next, create a trigger to send the event when someone clicks the button.

  1. Click the Triggering box in your GA4 Event tag.

  2. Click + on the top right.

  3. Enter a name for the trigger (e.g., "Trigger - Signup newsletter").

You can choose the conditions for sending the event. The following example sends the event based on the button label:

  1. Click the Trigger Configuration box in your trigger.

  2. Choose All Elements.

  3. Click Some Clicks.

  4. Set the following trigger condition: "Click Text contains Sign up for the newsletter".

  5. Save all your changes.

If you want the event to trigger when someone views a page (e.g., on a confirmation page), you could use a Page View trigger instead.

Step 3: Preview your changes

Before you publish your new event in Tag Manager, click Preview to see the data that's recorded when you click the "Sign up for the newsletter" button.

You can use preview mode to test changes to your container before you publish those changes to your website. Learn more about preview mode

See your events in Analytics

You can see your events and their parameters using the Realtime and DebugView reports. Note that the DebugView report requires some additional configuration before you can use the report. These two reports show you the events users trigger on your website as the events are triggered.

Did this answer your question?