Custom variables are, as Google documentation neatly explained, variables that you can attribute to the conversion event and enrich your data.
Custom variables can be highly beneficial when analyzing your advertising campaigns by giving you more insights into the traffic and new ideas on how to better segment your audience.
Example:
Hotel chain wants to see the conversion numbers split by these additional dimensions:
Hotel name
Room rate
Customer loyalty status
This way you can potentially see:
How many users clicked on an ad for hotel A but booked hotel B or C
Do users who own loyalty cards have higher AOV (average order value) compared to those that are not loyalty card owners
Which keywords generate traffic for higher rated rooms (more expensive rooms)
etc.
Custom Variables through GA4
There are a few ways to set up custom variables for GAds conversions according to Google official documentation but if you think any of them is through GTM you are out of luck.
It seems that currently there is no way of pushing custom variables for GAds conversions through Google Ads conversions tag (which you would think would be a no brainer).
Because of that and because of the fact that the majority of clients are using GTM for tracking purposes, we tried to find a way to set it up through GTM if possible.
And, it is possible!
GA4 is the answer.
Why is that good? Well, for one thing, mid 2023 UA will no longer be the main Analytical tool because GA4 is taking over and becoming the new industry standard.
This basically means that you will need to set up GA4 sooner or later.
It also means that when setting up GA4, you can set up custom dimensions that will be pushed to the connected GAds account and voila – you will have your custom variables.
Second thing is that you don’t need to additionally change the code on your web page (as suggested in the documentation) but instead you keep everything nice and neat in the GTM, which also means you will not have to chase down your developers to change the code every time you want to add something. You will have to chase down trackers for this though 🙂
How to set custom variables for GAds conversions using GA4
There are a few steps to setting this whole thing up:
Set up custom dimensions within GA4 event or configuration tag
Connect GA4 with respective GAds account
Activate all or some custom variables within GAds interface
After these steps you are good to go and now you can check your enriched reports.
Before you begin…
Before you begin setting up custom dimensions within your event or configuration GA4 tags you need to understand the basics because there are some differences between setup of custom dimensions for UA (which you might be more familiar with) and setting up custom dimensions for GA4.
The biggest difference here is that for UA custom dimensions can have hit, session, user or product level scope while in GA4 you have only user level or event level scope. This means that now, your custom dimension will basically describe either who triggered the event or the event itself
Also, you would need to adopt a more strategic approach when deciding on the custom dimensions not only because of the limited numbers of custom dimensions but also because those custom dimensions help you better understand your web visitors and can massively help you improve your online business.
When talking about limitations, the thing to keep in mind is that in a standard GA4 account the limit of user level custom dimensions is 25, while for event level the limit is 50. This emphasizes the need to consider what you want/need to track, under what category does it fall, and does it serve a purpose of better understanding your traffic and user behavior on the web site.
Set up custom dimensions within GA4 event or configuration tag
For the purposes of this article we are assuming that you have your dataLayer set up properly for GA4 tracking. If not, here is the official documentation on the dataLayer layout for GA4.
Let’s also say for the purposes of this article that you have done your homework and you are aware of all the custom dimensions that you want to push either through different GA4 events tags or GA configuration tag.
Let’s dive straight into the setup itself.
Step 1 – Set up the GA4 configuration tag
GA4 configuration tag is the main tag that fires on all pages and that is essential for all GA4 event tags.
It’s not too different looking than the classic GA settings variable for UA that you might have used for setting up UA tags.
Once you choose to create a new tag within the GTM interface you should choose Google Analytics: GA4 Configuration. After that you need to set up your Measurement ID. You can find your Measurement ID in the Admin panel in GA4 under Property > Data Streams.
Once you obtain Measurement ID write it down in the Measurement ID field, set up Page View trigger for All Pages and your GA4 Configuration tag is good to go.
Step 2 – Set up the GA4 events tag
Once you have your config tag all set up you can proceed to create a GA4 event tag.
In the tag configuration window you need to select a Configuration Tag that you previously created. After that you need to input the event name in the Event Name slot. The list of recommended event names for GA4 are available in the official Google documentation.
Once you have done that, next steps would be to add the custom dimensions under the Event Parameters and User Properties sections.
This is where a strategic preparation that was mentioned at the beginning kicks in. This is the spot where all the dimensions you want to track will be defined by name and by value. For the value portion you will need to create variables that extract the value of the dimension from dataLayer.
Final result might look something like this:
These dimensions, once published, will in future be populated in GA4, but if the GA4 is also connected to the GAds account you will be able to see them and use them in the GAds interface.
Step 3 – Custom variables in the GAds interface
To check custom variables in GAds you need to access your GAds account. Under Tools and Settings in the Top right corner choose Conversions and in the Conversions interface you will have an option to select Custom Variables on the left (example below):
NOTE: As mentioned before, you need to connect your GA4 with GAds to be able to see custom variables in the GAds interface.
By default all of the variables seen in GAds interface are not activated so you need to activate them. That is done simply by clicking on the Activate button in the last column on the right.
Once activated you will start to receive the data in the GAds and you will be able to segment your conversions based on these custom variables.
NOTE: If some custom variables are not sent for a particular event/conversion the output in the GAds interface for that custom variable will be “Not set”.
Step 4 – Segmenting per custom variable
Now that everything is set up you can segment your data in the GAds per custom variable by clicking on the segment and under conversions selecting the custom variable you wish to see. All those custom variables that were activated will be shown on the list.
Conclusion
Setting up your custom variables for GAds conversions through Google Analytics 4 is simple enough, but there is a lot of strategy that goes into it.
Luckily, GA4 is going to become an industry standard soon enough so this is a great way to have your cake and eat it too. 🙂
You want (actually need) custom dimensions to enrich your data in GA reports but also you will have them in GAds which will improve the way you see your data and your marketing efforts.