OptinMonster makes it easy to integrate your campaigns with Google Analytics for detailed reporting. View, filter and run detailed reports on campaign impressions and conversions using Google Analytics.
In this article, you’ll learn how to connect Google Analytics with OptinMonster.
Native Analytics:
Google Analytics integration is optional.
View native analytics for your campaigns in OptinMonster following this guide
Before you start, you’ll need to have an active Google Analytics account. Create your Google Analytics account.
Before you start, if you are not the owner of the Google Analytics account you are connecting to OptinMonster, you will need to be an Editor or Administrator level user.
Required: Custom Dimensions
Before you can run reports from your Google Analytics account, it is necessary to first create custom dimensions in Google Analytics for your GA4 Property.
To create custom dimensions for your OptinMonster campaigns in Google Analytics, follow these steps:
- Sign into your Google Analytics account.
- While viewing the Google Analytics property you wish to modify, click the gear icon in the lower left-hand corner. Then select the Data display > Custom definitions option.
- In the Custom definitions screen, select the Create custom dimension button.
- You’ll create three new Custom Dimensions: OM Campaign Name, OM Campaign ID, and OM Campaign Interaction. For each, set the Scope to Event, and enter the associated Event parameter as
om_campaign_name
,om_campaign_id
, andom_campaign_interaction
, respectively.
Learn more about using Custom Dimensions in Google Analytics
Connect Google Analytics
When you create a campaign in OptinMonster that you intend to track the detailed performance of you’ll want to integrate with Google Analytics.
To connect Google Analytics to OptinMonster, follow these steps:
- In the OptinMonster Campaign builder, navigate to the Analytics view and select the Connect button next to Google Analytics.
- If there are no existing Google Analytics integrations in your OptinMonster account you will be prompted to authenticate with Google Analytics.
Select the Generate Authentication Code button. - A popup window will open. If you are not already logged into Google Analytics you will first be prompted to do so. Then, select the Allow button to authenticate the connection between Google Analytics and OptinMonster.
- Next, you’ll be returned to OptinMonster and the Google Authorization Code field will automatically populate with the generated code.
Enter an Account Label (*internal use only) then select the Next button.*The Account Label can be anything that helps you identify the specific integration within OptinMonster. It’s possible to add more than one Google Analytics integration to your account and this is an easy way to differentiate between them when assigning integrations to individual campaigns.
- Required: Select the Property you want to send Analytics data to. You can send data to GA4 Properties.
- When you’re finished, Save the campaign.
Default Google Analytics
You can easily assign a default Google Analytics integration all campaigns you create, to streamline the integration process.
To assign a default Google Analytics integration, follow these steps:
- Navigate to the Sites page of your OptinMonster account.
- Next, select the Edit button for the site you wish to assign a default Google Analytics integration to.
- Scroll down to the Google Analytics setting, select the Google Analytics Account and GA4 Google Analytics Property you wish to assign as the default.
- Optional: You can apply this change to all existing and new campaigns connected to the Site you are editing by enabling the checkbox field.
- When you’re finished click the Save Changes button.
Remove Google Analytics
Individual Campaign
To remove Google Analytics integration from individual campaigns in your OptinMonster account, follow these steps:
- In the OptinMonster Campaign builder, navigate to the Analytics view and select the Disconnect button for Google Analytics.
- When you’re finished, Save your campaign.
Impressions and conversions will no longer be sent to Google Analytics.
Account-Wide
Warning:
This action cannot be undone and will disconnect Google Analytics from any and all campaigns that were integrated with it. You will need to manually reconnect each individual campaign if you wish to send analytics data to Google Analytics again.
To remove a Google Analytics integration from your account completely, follow these steps:
- Navigate to the Integrations page in your OptinMonster account.
- Select the Configure button below the Google Analytics icon.
- Next, select Disconnect next to the integration you want to remove.
Warning:
This will permanently delete the integration. There is no option to undo this action. If you decide to add the integration again you will need to manually reconnect individual campaigns.
- Finally, confirm the deletion by selecting Yes, I’m Sure.
Test Integration
GA4 Properties
Use the Realtime Report to test your Google Analytics integration without delay.
Learn how to test your campaign integration using Google Analytics’ Realtime report
View Analytics Data
Native Analytics:
Are you looking for analytics data within the OptinMonster app? Learn how to access the native analytics data for your campaigns here.
Google Analytics reports can be viewed directly from your Google Analytics account.
Learn how to view OptinMonster campaign reports in Google Analytics
Customize Event Data
Note:
The information available in this section is intended for users with advanced technical knowledge, where they have a specific requirement to change the data OptinMonster sends to Google Analytics.
The following OptinMonster Javascript Events are available that allow you to adjust event tracking to your needs:
You can use the OptinMonster Javascript Events indicated above to modify how the data is sent to Google Analytics.
For example, you could use the following to change the event name:
Or the following example to add custom event parameters to collect more information:
FAQs
Why do I see different impression counts in OptinMonster and GA4?
That’s a great question, and it’s very common to see different impression/conversion numbers in your OptinMonster dashboard compared to what you see in Google Analytics 4 (GA4). This is completely normal, and it doesn’t mean anything is broken!
The difference comes down to how each system tracks and records a campaign view.
Think of an OptinMonster Impression as the most direct and accurate count. Every single time we display one of your campaigns to a visitor, our own system immediately and reliably counts it.
A GA4 Impression, on the other hand, is only recorded when OptinMonster successfully tells Google Analytics that a campaign was shown, and the Google Analytics tracking script on your site successfully hears and records it.
Here’s a breakdown of the core differences.
- Tracking Method:
- OptinMonster: We track impressions directly through our own system and send the data straight to our servers. It’s a closed loop.
- GA4: It relies on its own separate tracking system being loaded and running correctly in your visitor’s web browser.
- Data Reliability:
- OptinMonster: Our native tracking works independently. It isn’t affected by most other scripts or browser extensions on the page.
- GA4: Its ability to count an impression depends entirely on its tracking code being properly loaded and initialized on your site, without being blocked.
- Counting Logic:
- OptinMonster: We count every single time a campaign is displayed. No exceptions, no estimates.
- GA4: On sites with a lot of traffic, GA4 may use a process called sampling, where it counts a percentage of impressions and then estimates the total number.
- Processing Requirements:
- OptinMonster: Our count happens instantly when the campaign is displayed.
- GA4: For the count to happen, the GA4 script must not be blocked by the visitor’s ad blocker or other privacy browser extensions, which is very common.
Why are my GA4 impression/conversion numbers consistently lower than in OptinMonster?
As we covered in the previous question, OptinMonster and GA4 are not the same thing. It is very common to see lower numbers in GA4. This doesn’t mean anything is broken! It’s usually due to one of these common scenarios:
- Many visitors use ad blockers which often stop Google Analytics from running. In this case, OptinMonster still counts the impression, but Google Analytics never receives the message.
- If a visitor’s internet is slow or there’s another script on your page that causes an error, the Google Analytics tracking code might not load properly. Again, we’ll count the impression, but GA4 won’t.
- Some visitors have browser settings that block all Google Analytics tracking for privacy reasons.
- On websites with very high traffic, Google Analytics might use sampling. This means it doesn’t record every single event but instead estimates the total based on a smaller sample. OptinMonster, on the other hand, always counts every impression.
Which impression/conversion metric should I trust for reporting?
You should trust OptinMonster’s native analytics for the most accurate count of how many times your campaigns were actually displayed or converted. Think of our numbers as the true display count. GA4 data is still very valuable for seeing how those campaign interactions fit in with all the other behaviors on your site, like page views and goal completions.
How does OptinMonster track impressions in GA4?
When a campaign is displayed to a visitor, OptinMonster sends a custom event to GA4 called optinmonster_impression
. This event also includes the campaign’s name and ID, which is why we had you set up those custom dimensions earlier! This allows you to filter and view data for specific campaigns right inside of Google Analytics.
Why might I see impression spikes in OptinMonster but not in GA4?
This usually comes down to timing and traffic volume. OptinMonster counts every single impression in real-time. During a big traffic spike, GA4 might use sampling (where it only counts a percentage of impressions and estimates the rest) or experience processing delays. So, you’ll always see the most immediate and complete data inside your OptinMonster dashboard.
Can I track conversions if I’m using a custom form?
Yes! You will need to modify your form’s code to track conversions when the form is submitted.
Learn how to track conversions with your custom HTML form
How can I bulk-assign a GA4 Property to all existing OptinMonster campaigns?
You can assign a GA4 Property to all existing campaigns following the Default Google Analytics section in this guide.
How can I find my GA4 Property ID?
When you connect OptinMonster to Google Analytics, you’ll see the GA4 Property ID displayed in braces after the name and domain of the Property for each item available, like this:
You can locate the GA4 Property ID in your Google Analytics account following this guide.
What data does OptinMonster send to Google Analytics?
OptinMonster sends the following data to GA4 Properties:
- Custom Event:
optinmonster_impression
- Custom Event:
optinmonster_conversion
- Custom Event:
optinmonster_interaction
For each Custom Event, we pass the following data as custom event parameters:
- Campaign Name (
om_campaign_name
) - Campaign ID (
om_campaign_id
) - Campaign Interaction (
om_campaign_interaction
)
It’s possible that Google Analytics may also track other data with this that we don’t control. However, the above details are all that OptinMonster sends to Google Analytics.
If you’re serious about jumpstarting your website business growth, then get started with OptinMonster today!
Get Started With OptinMonster Today!BONUS: Done-For-You Campaign Setup ($297 value)
Our conversion experts will design 1 free campaign for you to get maximum results – absolutely FREE!
Click here to get started →
Troubleshooting
Why can’t I find the Property I wish to assign?
In most instances, this happens when you do not have the correct permissions for the Property.
You must be one of the following for a Property to be available:
- The Google Analytics account owner
- OR be a user with Editor or Administrator access.
Learn more about Google Analytics user role assignments
My Google Analytics data doesn’t match OptinMonster’s in-house analytics data.
This is normal and not an indication of any errors.
Please be aware that:
- OptinMonster’s in-house analytics are exact metrics, we do not filter or sample any data so the numbers you see are the literal number of impressions and conversions for each campaign in your OptinMonster account.
- However, it is very common for Google Analytics to sample data and not provide you with the literal number of impressions and conversions.
Learn more about data sampling from Google Analytics
My website visits don’t match campaign impressions.
There are several reasons a campaign’s impression data does not match your overall pageview count in Google Analytics, including:
- Order of campaign loading: if you have multiple campaigns of the same type they will load on the page in the order they’re embedded in the DOM. If for some reason the visitor never proceeds through the first campaign that appears of that type they will not end up viewing any additional campaigns of that type until they do.
For example, assuming you have three lightbox campaigns embedded throughout your entire site:
– Scenario 1: The homepage is set to load all of the campaigns. Campaign 1 appears to the visitor but they exit the page before loading campaign 2 and campaign 3.
– Scenario 2: campaign 1’s page targeting excludes the campaign from loading on the homepage, as a result campaign 2 loads on the homepage first and there’s no impression counted for campaign 1 on this pageview. - Cookie Settings: OptinMonster allows you to set both Individual Cookies and Global Cookies to help control how often your campaigns appear to visitors.
– Individual Cookies: Once a visitor has successfully subscribed, or closed the campaign with the close icon, a cookie will be set for the number of days you’ve specified. Once that time has lapsed the campaign will appear to them again.
– Global Cookies: What this does is prevent any popup campaigns from appearing to a visitor only once they’ve successfully subscribed through one of your campaigns. This allows you to more finely tune the appearance of the campaign to your visitors. If you’ve set an individual cookie for any campaign and the visitor closes or submits the campaign they won’t continue to see that campaign even if they continue clicking through your site and generating pageview in Google Analytics. If you’ve set a global cookie for the domain and the visitor closes or submits an campaign they will not see any other campaigns on the site until the cookie duration has passed or they clear their browser’s cookies. See our cookie documentation for more details. - Desktop vs. Mobile: Is your campaign configured to load on only specific devices? You’ll want to be sure you’re filtering your overall Google Analytics page-views by the device used and compare to mobile vs. non-mobile campaigns running on your site.
- Configuration: Depending on the settings you’ve defined for each individual campaign it’s possible for Google Analytics to count a pageview (the webpage finishes loading) and for the visitor to navigate away from or exit your site before the campaign is shown to them. As a result, GA will reflect a pageview but your campaign will not count an impression since it did not appear to the visitor.
As a result, it’s rarely possible to run a direct comparison between the impression count of an individual campaign and the overall (unfiltered) pageview count of your site in Google Analytics.