Search

5 . 11 . 15

Universal Analytics Measurement Protocol Use Case Example


In my last post, I discussed how we’ve paired events that happen after a conversion point. For example, after a user submits an enquiry form, did they go on to book an appointment? This time, we’re going to discuss the UserID function and the analytics measurement protocol to measure online performance with offline outcomes.

The Measurement Protocol

The beauty of the measurement protocol in my view is that you do not need a webpage with an analytics snippet to fire analytics data. The enormity of this awesomeness goes beyond mobile analytics SDKs: what I’m talking about here is not just mobile apps: we can fire data directly from CRM systems, servers and applications into analytics.

Think beacons, smart fridges, etc – essentially, as long as it has the ability to do POST or GET requests and an internet connection, it can be done. Additionally, you can splice offline outcomes with online dimensions such as: which channel drove the most leads that resulted in the most actual customers.

The Method

First, compile your payload data. The payload data is what you want to send into analytics. It looks something like this:

v=1             
&tid=UA-XXXX-Y  
&cid=555        

&uid={{userID}}       
&t=event        
&ec=Conversion      
&ea={{Department}}        
&el={{Status}}

This is an example payload data for an analytics event. Notice that the parameter references are as you would expect them when you inspect analytics in your console:
analytics-debug

Parameter Reference

  • v=1 // API Version. Leave it as “1”
  • &tid=UA-XXXX-Y // The UA ID
  • &cid=555 // Anonymous GA Client ID – this should not be accessed directly as values can change unexpectedly. Instead use the ga.getAll()[0].get(‘clientId’); on window load method 
  • &uid={{userID}} // This is the User ID value (userID needs to be turned on. Privacy Policy to be updated. )
  • &t=event // This is the hittype. Leave it as Event for this example.
  • &ec=Conversion // Event Category. This is Required.
  • &ea={{Department}} // Event Action. Required. Here we have set it to the department this conversion applies eg. “Manchester Properties”
  • &el={{Status}} // Event label – the status of the application. ie “isCustomer” or “notCustomer”.
  • &ev= // Event value where applicable.

Other parameters to consider:

  • &cd1={{custRef}} // the reference number of said enquiry as a custom dimension if you require it. 
  • &ds={{dataSource}} // where this is data is coming from.

Implementation Notes

Note that this example uses Google Tagmanager-style variables in some parameter values – please do not do that. That’s just me denoting which values are dynamically pulled. In reality, the format of all parameters in the request must be on the same line, have no spaces between them, and not include comments eg:

v=1&tid=UA-XXXXX-Y&cid=555&t=pageview&dp=%2Fhome

You can send via a HTTP POST or GET method but analytics prefers POST for larger payloads. If you’re sending via a POST request, just remember to:

  • set the userAgent string. This must be correctly formatted otherwise it will not send.
  • the POST url (ie. where you want this data to be transported to). In this case it should be http://www.google-analytics.com/collect but if you’d like to send it over SSL, then this should be https://ssl.google-analytics.com/collect

Remember that you MUST accept Google Analytics’ Use Policy about USERIDs and update your privacy policies. You are not allowed to use PII information.

 

Now Apply It!

In the example above for instance, you can apply it to the following scenario for a say, Property Agent website:

Step 1) User logs in to their profile and submits an enquiry on the property website

Step 2) Enquiry is saved in server

Step 3) User then becomes an actual customer

Step 4) Server updates analytics

  • In point 1: that’s where the typical web conversion journey ends. You can measure this as a goal or an event in analytics already.
  • In point 2 and 3: the enquiry, which already has a unique reference number is updated with the status eg. “isCustomer”.
  • In point 4: Finally when this happens, the POST request from the server will send analytics the status update.

 

Seeing It In Analytics

You can see this data in tabular view in the usual Behavior > Events section in analytics as this payload example is specifically for an event. But I prefer creating a custom dashboard to visualize the data more meaningfully:

measurement-protocol-custom-dashboard-analytics-example

 

Taking It Further

  • Consider using custom dimensions to add bespoke dimensions that are meaningful to your business
  • Validate your hits, check data is coming through as expected in realtime, monitor your events
  • You can do more than just events: there’re Ecommerce tracking, social interactions, app tracking to explore!

Hope that was a useful read! :)

Want to find out more about what Analytics & CRO can do for your business? Contact us here.

Trent Y. is Head of Analytics and Conversion at twentysix. Analytics, usability and conversion strategies. Loves coffee, interested in how data and technology can positively impact our lives. “Learn fast, learn often.”

Share This:


Comments