Integrating CRM data via the Measurement Protocol to create AdWords Remarketing Audiences

This guide describes how to use the Measurement Protocol to integrate CRM data into Google Analytics and how to use that data to create remarketing audiences for AdWords.

Step 1: Enable Advertising Features for your property in Google Analytics

Advertising Features allows you to leverage Google Analytics to create remarketing lists for display and for search ads. Advertising features are enabled via a toggle in the admin interface, following these instructions.

Step 2: Configure Custom Dimension to hold your CRM data

You should configure one custom dimension for each CRM attribute that you are planning to import to Google Analytics via the measurement protocol.

To configure a custom dimension, from the Google Analytics Admin view, click custom definition, New Custom Dimension, give it a name and set the dimension scope to user.

Add custom Dimension with scope set to user.

Step 3: Create a remarketing list

From the Google Analytics Admin panel, click Remarketing -> Audience and create the remarketing list(s) you'd like to use for your RLSA campaign.

Under Advanced, select Conditions, and build your desired segment by selecting one or more of the custom dimensions corresponding to the CRM attributes you plan to populate.

Conditions filter configuration.

More information on how to create remarketing lists can be found here.

Step 4: Collect and store Google Analytics Client ID for your website visitors and map it to your CRM visitor identifier

There are two mechanisms which can enable you to tie your website traffic to your CRM data, as discussed in the overview article. If you have already implemented the User ID feature then you will not need collect the Google Analytics generated cid, continue to the next step. Otherwise, in order to send measurement protocol requests to Google Analytics and tie them to your website visitors, you must to collect the Google Analytics created cid and map it to your CRM ID for each visitor.

To get the cid for the current user browsing the site, call the following JavaScript function:

ga(function(tracker) {
  var clientId = tracker.get('clientId');
});

You should then pass the user's cid to your CRM or any other data store that you maintain along with the CRM ID you've set for this visitor.

After retrieving CRM attributes for your site visitors using the CRM ID as the visitor identifier, you'll be able to link this data to the corresponding Google Analytics cid.

Step 5: Send CRM data to Google Analytics via the measurement protocol

After retrieving CRM attributes for your recent visitors, you should send this data to Google Analytics via the measurement protocol API.

Every measurement protocol request must have a parameter indicating the type of hit being sent to Google Analytics. The hit type can be pageview, event or transaction. To avoid sending to Google Analytics unwarranted pageviews or transactions that will affect your site's traffic data, we recommend sending CRM attributes along with an event hit type. Event hits must have an event action and event category parameter. Any arbitrary value can be used to set those parameters.

Make those API calls by sending an HTTP POST request to www.google-analytics.com/collect and passing the following POST data payload:

cid

v=1  // Measurement Protocol version.
tid=UA-XXXXXXX-Y  // The Tracking ID for the property.
cid=####.####     // The user's Google Analytics cid.
t=event           // The measurement protocol hit type.
ec=crm            // An arbitrary event category, any value can be used.
ea=update         // An event action, any value can be used.
cd1=xxxx          // Custom dimension index 1 value, your first CRM user attribute.
cd2=xxxx          // Custom dimension index 2.
ni=1              // This sets the hit as a non interaction hit.

User id

tid=UA-XXXXXXX-Y // The Tracking ID for the property. uid=####.#### // Your User ID t=event // The measurement protocol hit type. ec=crm // An arbitrary event category, any value can be used. ea=update // An event action, any value can be used. cd1=xxxx // Custom dimension index 1 value, your first CRM user attribute. cd2=xxxx // Custom dimension index 2. ni=1 // This sets the hit as a non interaction hit.

The parameters used to pass the custom dimension values are labeled cd1, cd2, etc... The number should match the custom dimension index that was assigned when you created each custom dimension in step 2.

The ni=1 parameter sets this hit to be a non-interaction hit, which means it will not cause Google Analytics to start a new visit and impact your regular web traffic metrics.

The Google Analytics Measurement Protocol documentation can be found here.

You can verify that your measurement protocol requests are going through as you are sending them by looking at Google Analytics's real time reports, which should reflect activity associated with your measurement protocol requests as they are being sent from your server.