• HEX: #e5f0f5
  • RGB: rgb(229, 240, 245)
  • HEX: #1e5e7d
  • RGB: rgb(30, 94, 125)
  • HEX: #8eafc0
  • RGB: rgb(142, 175, 192)
  • HEX: #747474
  • RGB: rgb(116, 116, 116)
  • HEX: #7c7c7c
  • RGB: rgb(124, 124, 124)

Marketo API Driven Google Analytics Custom Dimensions

Marketo isn’t the best with reporting. I find their analytics to be quite janky, visually unappealing, and kind of annoying to build.

Something I’ve wanted to do for a while is build in Marketo data into our Google analytics. I did this using Google Analytics Custom Dimensions.

Because I previously integrated MODX  with Marketo I am now able to pass lead data to custom dimension parameters in the Google Analytics javascript snippet that they provide.

As an example here is what I’m currently running on Google Analytics.

 


	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
	  
	  ga('create', 'xx-xxxxxxx-x', 'auto');
	  ga('send', 'pageview', {
	  'dimension1':'[[!+mkto.Email:default=`Anonymous`]]',
	  'dimension2':'[[!+mkto.Industry:default=`Unknown`]]',
	  'dimension3':'[[!+mkto.modxSalesforceOwner:default=`Unassigned`]]'
	});

In this snippet I am measuring the email (unique lead identifier), industry, and salesperson of everyone that visits our site! This allows me to do some really neat stuff in google analytics when it comes to reporting, and I love me some google analytics reporting.

Leads

Screen Shot 2015-02-13 at 3.26.24 PM

Industries

Screen Shot 2015-02-13 at 3.24.58 PM

Salesperson Traffic

Salesperson Custom Dimension

Next up is measuring specific events, custom metrics, and other fun stuff. I’ll hopefully put up a post soon! 


Subscribe for More!


I send out a monthly newsletter on various topics.

Take a moment to enter your details, and you can select the news you would like to have delivered to your inbox!