This guide may be useful for you in case you installed Google Analytics via Google Tag Manager in order to measure the performance of your website. By following the instruction below, you will be able to monitor the performance of your OptiMonk campaigns in Google Analytics 4.
OptiMonk automatically pushes all the necessary events to Google Analytics, but you need to set up a custom event through GTM (Google Tag Manager) to be able to measure the performance of your OptiMonk campaigns in GA4 correctly.
In this article, we'll show you how to
- Set up GA4 tracking by importing container (suggested)
- Set up Google Tag Manager manually
- Set up Custom Definitions in GA4
- Set up audiences in GA4
- Use custom audiences for reporting in GA4
1. Open Google Tag manager and import container (suggested)
Please follow the below steps to set up the reporting for your Google Tag Manager account:
1. Download the optimonk-ga4.json file HERE.
2. Open Google Tag Manager, select the Admin menu and navigate to Import Container.
3. Select the downloaded json file and import it with the following settings.
4. If everything goes well then you’ll see the following items added to your workspace
5. Now all you need to do is to select the new “OptiMonk Event Reporting GA4” tag and provide the measurement ID of your GA4 account then save and publish.
6. To find the Measurement ID in GA4, navigate to Admin / Data Streams.
7. Here, you should see only one data stream receiving traffic. Click on that.
2. Set up Google Tag Manager manually
If you already went through the steps in 1, you don't have to set it up manually again.
Otherwise, follow these steps:
1. Click on the New Tag.
2. Choose the GA4 event as Tag type.
3. Add Tag configuration with the following settings.
4. To find the Measurement ID in GA4, go to Admin / Data Streams.
5. Here, you should see only one data stream receiving traffic. Click on that.
6. Add a Custom trigger as follows:
7. After saving, this is how your tag should look like.
8. The only thing left to do is Submit changes in Google Tag Manager.
3. Set up Custom Definitions in Google Analytics 4
Now that you have finished setting up your Google Tag Manager, it's time to configure your Google Analytics 4 account correctly.
1. Open Google Analytics 4, go to Settings, then find Custom definitions:
2. We recommend setting up the following three Custom definitions with their parameters:
- OptiMonk Campaign Action (om_campaign_action)
- OptiMonk Campaign Category (om_campaign_category)
- OptiMonk Campaign Name (om_campaign_name)
❗ After submitting this, you will need to wait up to 24 hours before continuing with the rest of the setup process. This time is necessary for GA4 to recognize all events (most settings in GA4 are not real-time, and have a delay of 1 to 24 hours).
4. Set up Audiences
The final step is to set up audiences based on the events. There will be two audiences:
- OptiMonk Shown: Users who have seen any OptiMonk campaign (at least 1 impression).
- OptiMonk Filled: Users who have filled out any OptiMonk campaign (at least 1 conversion).
Optionally, you can also set up audiences for actions such as "close(x)" (users who clicked on the closing X in a popup) and "no" (users who explicitly clicked on a "no thanks" or similar link in a popup).
1. Navigate to Settings in Google Analytics 4 and click on New audience.
2. In the Include Users dropdown find the “optimonk_campaign_event”:
3. Here chose “OptiMonk Campaign Action” in the parameter, and chose the “contains” parameter, and set it to “shown”.
4. You need to repeat the above process with the filled event:
Now you are all set! In 24 hours you’ll be able to use these audiences.
5. Use custom audiences in Google Analytics 4
After 24 hours have passed, you can go to any report and use these audiences for comparisons. For example.
1. Go to your selected report and click on Add comparison.
2. In the Build comparison menu chose Audience name as property:
3. Set it to OptiMonk Shown or OptiMonk Filled, based on what kind of comparison you want to do.
4. Here is what such a comparison will look like:
And you're all done!
✉️ If you need any further help or have any questions, please let us know at email@example.com, and we would be happy to assist you :)