Google Analytics 4 integration
bmetric support sending data to your Google Analytics 4 property. This guide is for setting up the server side tracking.
bmetric support sending data to your Google Analytics 4 property. This guide is for setting up the server side tracking.
Data flow
When a visitor enters your website, the bmetric script runs in the background and collects key values and IDs for that visitor. Later, after a call is finished, we use this information to send data via the measurement protocol to your Google Analytics 4 property. This allows bmetric data to be linked and combined with your Google Analytics 4 sessions.
We use the google_analytics_session value and google_analytics_visitor_id values for stitching.
Disclaimers
The integration with Google Analytics 4 will only work for sessions where both Google Analytics 4 and bmetric scripts run, i.e. cookie consent granted if relevant.
To support the integration, please ensure that the scripts for Google Analytics 4 run before the bmetric script on your website.
Use case examples
When using the default reports in Google Analytics 4, you can view bmetric events by going to Reports → Life cycle → Engagement → Events. From here you can set up filters to show specifically bmetric data (i.e. Event name exactly matches “bmetric”) or specific bmetric fields, like label or action.
You can view which specific pages a bmetric event happened on by combining the event name = “bmetric” or specific action types, like action = “Calltracking”, with the page location or page title.
You can add-on bmetric data to pre-existing reports in Google Analytics 4. You can do this by simply going to the table of the report (below the graph) and clicking on the ”+“-sign and add “action”; with that you can add-on bmetric data to any report already set up.
Setup
To set up the integration between bmetric and Google Analytics 4, you collect the following from your Google Analytics 4 account:
- Measurement ID
- API Secret key
You need to set up the following in Google Analytics 4:
- Custom event
- Custom dimensions
Follow the below guide.
Locating the Measurement ID and API Secret Key
In Google Analytics 4, Navigate to the Admin-panel, then click on Data streams under Property. Click on the relevant data stream; you will see the Measurement ID on the right side.
In the same window, click on Measurement Protocol API secrets. Now, click on Create to create a new key.
Setting up the custom event
Navigate to Admin → Events → Create event → Create. Fill out the following:
Custom event name: bmetric
Under Matching conditions,
- Parameter: event_name
- Operator: contains
- Value: bmetric
Under Parameter configuration,
Copy parameters from the source event:
If you are running calltracking only, use the below parameters:
| Parameter | New Value |
|---|---|
| action | forward_number |
If you are running engagements/forms with or without calltracking, use the below parameters:
| Parameter | New Value |
|---|---|
| action | forward_number |
| shown | description |
| action | label |
Note: forward_number is only required if you have either calltracking and/or call-ins through engagements running. If you do not, then forward_number can be ignored.
Save the custom event.
Setting up the custom dimension
Navigate to the Admin-panel, then click on Custom definitions under Property, you should now be in Custom dimensions. Click on Create custom dimensions.
If you are running call-tracking only, use the below dimensions:
| Dimension name | Scope | Description | Event parameter |
|---|---|---|---|
| action | Event | action | |
| forward_number | Event | forward_number |
If you are running engagements/forms with or without calltracking, use the below dimensions:
| Dimension name | Scope | Description | Event parameter |
|---|---|---|---|
| action | Event | action | |
| shown | Event | shown | |
| description | Event | description |
Note: forward_number is only required if you have either calltracking and/or call-ins through engagements running. If you do not, then forward_number can be ignored.
Note: If you already have custom dimensions set for action and/or label/description, these can be used and no additional dimensions need to be made. If that is the case, change Parameter in your bmetric event to match this dimension.
Page_location and Page_title are default dimensions in GA4. They will not be shown in the bmetric event, but event will have these two stitched to it in reports.
Setup on the bmetric platform (call-tracking)
Please go to bmetric call-tracking overview and click on Edit next to the relevant campaign(s). From here, go to Settings. Scroll down to Third Party Integrations and select Google Analytics 4 from the drop-down.
Make sure the checkbox next to Enabled is checked (found in the top right corner).
Enter your measurement ID and API Secret key in the marked fields.
Click on the ”+“-icon next to GA4 Events.
Enter a Event Name (recommended: bmetric).
Now add the relevant GA4 attributes for your setup. In the left field you can write your own parameter name, though they need to match what you set up in Google Analytics 4 custom dimensions and custom event. The right field is the bmetric datapoint you wish to pull. For calltracking, we recommend the following setup:
- action →
{action} - forward_number →
{forward_number}
Remember to click the Save button before leaving the page.
Setup on the bmetric platform (EE/CFB)
Please go to bmetric EE/CFB overview and click on the relevant campaign(s). From here, go to Analytics. Open the drop-down menu and select Google Analytics 4.
Make sure the checkbox next to Enabled is checked (found in the top right corner).
Enter your measurement ID and API Secret key in the marked fields.
Click on the ”+“-icon next to GA4 Events.
Enter a Event Name (recommended: bmetric).
Now add the relevant GA4 attributes for your setup. In the left field you can write your own parameter name, though they need to match what you set up in Google Analytics 4 custom dimensions and custom event. The right field is the bmetric datapoint you wish to pull. For calltracking, we recommend the following setup:
- action →
{action} - forward_number →
{forward_number} - description →
{label}
If you are not running calltracking and/or call-ins through engagements, then forward_number can be skipped. If you want to receive impressions data, then remember to check the box Send shown events to analytics integrations.
Remember to click the Save button before leaving the page.
Import conversions to Google Ads
You can optionally import bmetric conversions from your Google Analytics 4 account to your Google Ads account. To do so, please follow the official documentation here: Import Google Analytics conversions into Google Ads — Google Ads Help
Alternatively, you can also have a separate integration between bmetric and Google Ads; for this, please reach out to your account manager.