Hello! Today, I’ll explain the steps you need to take in your Google Analytics 4 (GA4) account to prepare for attribution in Windsor AI.
Preparing for attribution involves two steps:
- Setting up a client_id for users on the Google Tag Manager (GTM) side.
- And adding custom dimensions.
We will cover all these steps now, but before you get started, make sure you have set up GA4 with a data stream and have GTM installed. Also, make sure you’re using the standard connector between GA4 and GTM in Google Analytics 4: Configuration tag type, if you don’t we create this tag at step 2.
Setup before reading:
- Google Analytics 4 (with data stream activated)
- Google Tag Manager account with admin rights(!)
Google Tag Manager (GTM Configuration)
Now, let’s set everything up in GTM.
- To get started, add this template from the GTM templates gallery. To do this, you need to open your GTM container here: https://tagmanager.google.com/?authuser=1#/home
Then go to Templates: here you need to click on “Search Gallery” and find there GTAG GET API
and after selecting it click “Add to workspace”
- Then in your GTM tags, you should see the “Google Analytics: GA4 Configuration” tag type. If you don’t have this tag yet, create a new tag and select “Google Analytics: GA4 Configuration”
<as the tag type and save it.
- Next, create a new tag and name it “save clientid” (or any name you prefer). Your screen should now look like this:
- Now you need to set the GA4 Measurement ID in the appropriate field.
Here’s how to find it:
– Go to your GA4 property and click on “Admin” at the bottom left.
– Under “Property”, click “Data streams”.
– Click on “Web”.
– Click on your web data stream name.
– Your measurement ID is located in the top right corner. Copy it and paste it into the appropriate field in GTM.
- Good! Then you need to go back to tag with Google Analytics 4: Configuration from step 2. Then, open Advanced Settings -> Tag Sequencing. Set this tag to fire after the “save clientid” tag that we created earlier:
Don’t forget to click “Save” to apply these changes.
- Next, we need to create Custom Event trigger: “gtagApiGet” event and set up the necessary Data Variables
- To do this, go to the “Triggers” section in GTM.
- Then, click “New”.
- Add a new trigger and name it “gtagApiGet”. Set the trigger type to “Custom Event”.
- Now, let’s add the necessary “Variables”. Go to the “Variables” section in GTM.
- Here, we only need to add one variable for the client ID. You just simply click “New” to create a new variable.
- Next, fill in all the necessary fields with the following data:
Name(at the top): gtagApiResult.client_id
Variable Type: Data Layer Variable
Data Layer Variable Name: gtagApiResult.client_id
Data Layer Version: Version 2
- Finally, click “Save” to save all the changes you’ve made.
- The last step for GTM is to create a new Google Analytics 4 Event Tag. To do this, go to the “Tags” section, click “New”, and name the tag “fetch_user_data”. Fill in all the other fields with the following information:
Tag type: Google Analytics: GA4 Event
Configuration Tag: Google Analytics GA4 Configuration
Event Name: fetch_user_data
Under User Properties
Property Name: custom_client_id
IMPORTANT: don’t miss the dot at the end of the value
Firing Triggers: here we need to set our gtagApiGet that we set before.then just click “Save”.
- After that, click on the “Preview” button in the upper right corner of the GTM interface.
- There you enter your site address and navigate to a few pages to check if the “gtagApiGet” function was fired and if the client_id is in the correct location.
- Now after you made all these changes go to the main menu and click on “Submit”
here you need to name these changes, let’s use “windsor.ai ga4 attribution setup” and click “Publish”
- If you want to test your GTM setup you can do it in two ways:
1. You can use “Preview” as we did in step 7, but this time you need to check that “fetch_user_data” was triggered and have client_id as we saw it in step 8.
2. You can use the Debugger tool. You can find instructions on using it under the app screenshots on the debugger page. When you run the Debugger on your site, you should be able to see the client ID that we set up earlier.
Google Analytics 4 (GA 4) Configuration
Now that all the settings in GTM are complete, we can move on to Google Analytics 4 (GA4).
- Open your admin panel in GA4.
- Then, open Custom Definitions.
- Click the Create custom dimensions button.
And here we need to add a field from our `fetch_user_data` that we created at the end of GTM section.
Dimension name: custom_client_id
Description: client_id custom dimension
User property: custom_client_id
- Now you can go to Explore -> Create blank report
- Click the “+” sign to add a new dimension
- You can also add “sessions” metric to be able to see the number of sessions by client_id.
NOTE: you won’t be able to see client_id instantly because GA4 need some time to gather them, we recommend checking them in 24h.
- From there, you should be able to see the custom dimensions you added and use them to explore your data.
Up next here are the instructions on how to proceed with the setup on Windsor.ai:
Setting up Google Analytics 4 (GA4) Multitouch Attribution with Windsor.ai is simple and can be done by following these easy steps:
- Go to onboard.windsor.ai and log in to your account. Register one if you don’t have one.
- Select the Google Analytics 4 (App+Web) data source and sign in to your GA4 account using your Google credentials. Provide Windsor.ai with all the necessary permissions.
- Select the GA4 accounts that you want to use for Multitouch Attribution.
- Check the checkbox to use GA4 Multitouch Attribution. After this, a field will appear where you need to enter the name of the client ID Custom Dimension that you set in GA4 during the first step of the guide. Then click “Add”. NOTE: if you refresh the page you will see the“customuser_” was attached to the name of custom_client_id. This is expected behavior and you don’t need to change it back just leave it as it is.
- Go to the data preview page.
- On the data preview page, select one of the desired Multitouch Attribution dashboards: ROAS or CPA.
- We will ask you to enter your Windsor.ai account password, which will also be used to access your dashboard in the future on charts.windsor.ai.
- Wait a few minutes while we create your dashboard.
- Once the dashboard is ready, click on the hyperlink to view it.
- Congratulations! Your dashboard is now available at https://charts.windsor.ai and can be accessed using your Windsor.ai login and password. Please note that the data on the dashboard will be updated once a day at 01:00.
- Here you can read how to increase Marketing ROI with our Multi-touch Attribution Modelling Software.