{"id":49203,"date":"2019-07-23T07:00:55","date_gmt":"2019-07-23T14:00:55","guid":{"rendered":"https:\/\/eigene-homepage-erstellen.net\/?p=49203"},"modified":"2024-09-05T08:16:10","modified_gmt":"2024-09-05T15:16:10","slug":"online-to-offline-attribution-made-simple","status":"publish","type":"post","link":"https:\/\/eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm","title":{"rendered":"Online-To-Offline Attribution Made Simple"},"content":{"rendered":"\n

Note: If you’re looking for a more comprehensive understanding of attribution, check out our Digital Marketer’s Guide to Attribution<\/a> for more info.<\/em><\/p>\n

The biggest issue facing most B2B lead-generation organizations today is attributing their best leads—you know, the ones that end up becoming paying customers—back to the marketing activity (or activities) that drove them to the website: paid campaigns, specific content, all that good stuff.<\/p>\n

Turns out, it’s not so hard to bridge the gap between your CRM, marketing automation (MA), and web analytics platforms if you know where to start. It’s a process called “closed-loop analytics<\/a>.”<\/p>\n

Researching an Integration<\/h2>\n

Here at Portent, we use HubSpot for marketing automation and as our CRM. So, naturally, we were chomping at the bit to integrate with Google Analytics<\/a> for our online-to-offline attribution.<\/p>\n

If you’ve ever looked into this kind of integration before, Google’s documentation for integrating with popular CRMs is non-existent, with the exception of Google Analytics 360’s integration with Salesforce Marketing Cloud<\/a>, which is exclusive to folks paying for the expensive, premium version of GA. There really are no best practices for this for free GA users. It’s the wild west out there.<\/p>\n

So where does one begin? The key is setting a non-PII (Personally Identifiable Information) User ID, which will serve as a way to join the online and offline data sets together in the reporting layer. (Note:<\/strong> Google Analytics doesn’t accept PII like email addresses or phone numbers.)<\/p>\n

Setting a Unique Identifier<\/h2>\n

Portent developer extraordinaire, Andy Schaff<\/a>, formulated a simple script that serves two purposes:<\/p>\n

    \n
  1. To set a random unique identifier cookie for each website visitor (called RUID for short).<\/li>\n
  2. To pass that ID as a hidden form field into any lead form the visitor fills out during their visit.<\/li>\n<\/ol>\n

    Here’s the script:<\/p>\n

    \nfunction setCookie(cname, cvalue, exdays) {\n  var d = new Date();\n  d.setTime(d.getTime() + (exdays*24*60*60*1000));\n  var expires = \"expires=\"+ d.toUTCString();\n  document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=\/\";\n}\nfunction getCookie(cname) {\n  var name = cname + \"=\";\n  var decodedCookie = decodeURIComponent(document.cookie);\n  var ca = decodedCookie.split(';');\n  for(var i = 0; i <ca.length; i++) {\n    var c = ca[i];\n    while (c.charAt(0) == ' ') {\n      c = c.substring(1);\n    }\n    if (c.indexOf(name) == 0) {\n      return c.substring(name.length, c.length);\n    }\n  }\n  return \"\";\n}\n\/\/ searches all input elements on the page with an id that starts with \"_guid_\" and writes the provided value\nfunction populateFormFields(value) {\n  var inputs = document.getElementsByTagName(\"input\"), item;\n  for (var i = 0, len = inputs.length; i < len; i++) { \n    item = inputs[i];\n    \/\/ item.id starts with _guid_\n    if (item.id && item.id.indexOf(\"_guid_\") == 0) {\n      document.getElementById(item.id).value = value;\n    }\n  }\n} \n\/\/ if cookie \"ruid\" does not exist, generate and write \nif (!getCookie(\"ruid\") || getCookie(\"ruid\") == \"\") { \n  var ruidCookie = \"\";\n  var chars = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  var length = 10;\n  for (var i = length; i > 0; --i) \n    ruidCookie += chars[Math.floor(Math.random() * chars.length)];\n  \n  \/\/ set \"ruid\" cookie with our alpha-numeric value. expires in 182 days, or ~6 months\n  setCookie(\"ruid\", ruidCookie, 182);\n  \/\/ set the \"ruid\" cookie value to the form field upon initial creation. this is an edge case for when a user first lands on the page\n  populateFormFields(ruidCookie);\n} else if (getCookie(\"ruid\")) {\n  \/\/ set the \"ruid\" cookie value to the form field.\n  populateFormFields(getCookie(\"ruid\"));\n}\n<\/code><\/pre>\n

    You might say “this looks like gibberish to me” and wonder how to deploy it to your website. Fortunately, this can be rolled out using a custom HTML tag via Google Tag Manager<\/a> without bothering your developer.<\/p>\n

    Passing the RUID into Google Analytics<\/h2>\n

    While you’re there deploying the RUID script in Google Tag Manager, you can also, conveniently, send it to Google Analytics with every pageview that occurs, even before a visitor fills out a form.<\/p>\n

    You do this by setting a User-Defined Variable<\/a> which scrapes the value of the RUID cookie.<\/p>\n

    After the variable exists, you can send it to Google Analytics with every hit as a Custom Dimension using the Google Analytics Settings Variable<\/a>.<\/p>\n

    Note:<\/strong> This also requires a User-Scoped Custom Dimension<\/a> to be set up in Google Analytics (which generates the Index number “1” seen in the screenshot above).<\/em><\/p>\n

    Sending the RUID into Your CRM<\/h2>\n

    The last important step before you get to your beautiful new closed-loop analytics report is setting up a field in your CRM system to receive the hidden RUID form field established earlier in Andy’s script.<\/p>\n

    Most CRM and MA platforms have the capability to establish “Custom Fields” that can be associated with any incoming contacts or leads to enrich the database with business-specific information. The creation of these fields and including them in the website lead forms is a slightly different procedure for each platform. Here’s an explanation of the process for several popular platforms.<\/p>\n

    We’ll be using HubSpot in our example, but we’ve included instructions to configure this field in other popular CRM and MA platforms.<\/p>\n

    Setting up Custom Properties in HubSpot<\/h3>\n

    To generate a custom property in HubSpot<\/a>, you go to Settings > Properties > Create a property<\/strong>.<\/p>\n

    Setting up Custom Fields in Pardot<\/h3>\n

    To generate a custom field in Pardot<\/a>, you go to Admin > Configure Fields > Prospects<\/strong>. Only Administrators can create this<\/em>.<\/p>\n

    You can also set these fields to map to your Salesforce instance<\/a>.<\/p>\n

    Setting up Customer Fields in Marketo<\/h3>\n

    To generate a custom field in Marketo<\/a>, you go to Admin > Field Management > New Custom Field<\/strong>.<\/p>\n

    Setting up Custom Fields in Eloqua<\/h3>\n

    To generate a contact field in Eloqua<\/a>, you go to Settings > Fields & Views > Add + > Add Contact Field<\/strong>.<\/p>\n

    Joining CRM Data to Analytics Data by RUID<\/h2>\n

    Once you have the RUID appearing in both your CRM and Google Analytics, you can use data blending<\/a> in Google Data Studio.<\/p>\n

    If you can export Lead Status information out of the aforementioned CRM platforms by User ID and store it in Google Sheets, you can join the data to any information we have in Google Analytics around that User ID (i.e., all of their web sessions, campaigns, content).<\/p>\n

    Here’s what our blend looks like:<\/p>\n

    Once the blend is set up, you can get tables like these to introduce lead quality data to web analytics data:<\/p>\n

    Tada! More Info on Your Best Leads<\/h2>\n

    Now that you have a fairly straightforward way to tie online and offline information together, you can start thinking about things like Lead Scoring and bringing any PII associated with your IDs back into dashboards for your marketing and sales teams.<\/p>\n

    For an in-depth guide on how this works for PPC read our guide on how to track offline conversions in google ads<\/a>.<\/span><\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"

    Note: If you’re looking for a more comprehensive understanding of attribution, check out our Digital Marketer’s Guide to Attribution for more info. The biggest issue facing most B2B lead-generation organizations today is attributing their best leads—you know, the ones that end up becoming paying customers—back to the marketing activity (or activities) that drove them to […]<\/p>\n","protected":false},"author":135,"featured_media":49213,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13],"tags":[625],"coauthors":[],"class_list":["post-49203","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-attribution"],"acf":[],"yoast_head":"\nOnline-To-Offline Attribution Made Simple - Portent<\/title>\n<meta name=\"description\" content=\"Connect leads and offline sales to your web analytics with online-to-offline attribution. See how simple it is to get the data you need.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Online-To-Offline Attribution Made Simple\" \/>\n<meta property=\"og:description\" content=\"Connect leads and offline sales to your web analytics with online-to-offline attribution. See how simple it is to get the data you need.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm\" \/>\n<meta property=\"og:site_name\" content=\"Portent\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/portent.marketing\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/MichaelWiegand\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-23T14:00:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-05T15:16:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.eigene-homepage-erstellen.net\/wp-content\/uploads\/2019\/08\/oo-attribution-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2398\" \/>\n\t<meta property=\"og:image:height\" content=\"650\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Michael Wiegand\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Online-To-Offline Attribution Made Simple\" \/>\n<meta name=\"twitter:creator\" content=\"@mwiegand\" \/>\n<meta name=\"twitter:site\" content=\"@portent\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Wiegand\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Online-To-Offline Attribution Made Simple - Portent","description":"Connect leads and offline sales to your web analytics with online-to-offline attribution. See how simple it is to get the data you need.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm","og_locale":"en_US","og_type":"article","og_title":"Online-To-Offline Attribution Made Simple","og_description":"Connect leads and offline sales to your web analytics with online-to-offline attribution. See how simple it is to get the data you need.","og_url":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm","og_site_name":"Portent","article_publisher":"https:\/\/www.facebook.com\/portent.marketing","article_author":"https:\/\/www.facebook.com\/MichaelWiegand","article_published_time":"2019-07-23T14:00:55+00:00","article_modified_time":"2024-09-05T15:16:10+00:00","og_image":[{"width":2398,"height":650,"url":"https:\/\/www.eigene-homepage-erstellen.net\/wp-content\/uploads\/2019\/08\/oo-attribution-1.png","type":"image\/png"}],"author":"Michael Wiegand","twitter_card":"summary_large_image","twitter_title":"Online-To-Offline Attribution Made Simple","twitter_creator":"@mwiegand","twitter_site":"@portent","twitter_misc":{"Written by":"Michael Wiegand","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm#article","isPartOf":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm"},"author":{"name":"Michael Wiegand","@id":"https:\/\/www.eigene-homepage-erstellen.net\/#\/schema\/person\/fb71251fec3823d81a4dca546522d746"},"headline":"Online-To-Offline Attribution Made Simple","datePublished":"2019-07-23T14:00:55+00:00","dateModified":"2024-09-05T15:16:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm"},"wordCount":868,"commentCount":15,"publisher":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/#organization"},"image":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm#primaryimage"},"thumbnailUrl":"https:\/\/eigene-homepage-erstellen.net\/wp-content\/uploads\/2019\/08\/oo-attribution-1.png","keywords":["attribution"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm","url":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm","name":"Online-To-Offline Attribution Made Simple - Portent","isPartOf":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm#primaryimage"},"image":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm#primaryimage"},"thumbnailUrl":"https:\/\/eigene-homepage-erstellen.net\/wp-content\/uploads\/2019\/08\/oo-attribution-1.png","datePublished":"2019-07-23T14:00:55+00:00","dateModified":"2024-09-05T15:16:10+00:00","description":"Connect leads and offline sales to your web analytics with online-to-offline attribution. See how simple it is to get the data you need.","breadcrumb":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm#primaryimage","url":"https:\/\/eigene-homepage-erstellen.net\/wp-content\/uploads\/2019\/08\/oo-attribution-1.png","contentUrl":"https:\/\/eigene-homepage-erstellen.net\/wp-content\/uploads\/2019\/08\/oo-attribution-1.png","width":2398,"height":650,"caption":"Screenshot of setting a user-defined variable for a RUID cookie in Google Analytics"},{"@type":"BreadcrumbList","@id":"https:\/\/www.eigene-homepage-erstellen.net\/blog\/analytics\/online-to-offline-attribution-made-simple.htm#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/eigene-homepage-erstellen.net\/"},{"@type":"ListItem","position":2,"name":"Online-To-Offline Attribution Made Simple"}]},{"@type":"WebSite","@id":"https:\/\/www.eigene-homepage-erstellen.net\/#website","url":"https:\/\/www.eigene-homepage-erstellen.net\/","name":"Portent","description":"Digital Marketing Agency - Seattle, WA","publisher":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.eigene-homepage-erstellen.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.eigene-homepage-erstellen.net\/#organization","name":"Portent","url":"https:\/\/www.eigene-homepage-erstellen.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.eigene-homepage-erstellen.net\/#\/schema\/logo\/image\/","url":"https:\/\/portent.wpenginepowered.com\/images\/2018\/08\/logo-indigo.svg","contentUrl":"https:\/\/portent.wpenginepowered.com\/images\/2018\/08\/logo-indigo.svg","width":182,"height":40,"caption":"Portent"},"image":{"@id":"https:\/\/www.eigene-homepage-erstellen.net\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/portent.marketing","https:\/\/x.com\/portent","https:\/\/www.linkedin.com\/company\/portent\/"]},{"@type":"Person","@id":"https:\/\/www.eigene-homepage-erstellen.net\/#\/schema\/person\/fb71251fec3823d81a4dca546522d746","name":"Michael Wiegand","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.eigene-homepage-erstellen.net\/#\/schema\/person\/image\/1064b40d178c21d61c74375369c9e1d9","url":"https:\/\/secure.gravatar.com\/avatar\/094ed9d266a49f6363bf77d32cfff714?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/094ed9d266a49f6363bf77d32cfff714?s=96&d=mm&r=g","caption":"Michael Wiegand"},"description":"Over two decades as a marketer, Michael's experience has run the gamut from design, development, direct mail, multivariate testing, print and search. He now heads Portent's analytics practice, overseeing everything from Google Tag Management, to CRM integration for closed-loop analytics, to solving ponderous digital marketing questions. Outside of work, he enjoys recording music, playing D&D, and supporting Seattle Sounders FC.","sameAs":["https:\/\/www.facebook.com\/MichaelWiegand","https:\/\/www.linkedin.com\/in\/mwiegand\/","https:\/\/x.com\/mwiegand"],"url":"https:\/\/eigene-homepage-erstellen.net\/blog\/author\/mwiegand"}]}},"author_meta":{"display_name":"Michael Wiegand","author_link":"https:\/\/eigene-homepage-erstellen.net\/blog\/author\/mwiegand"},"featured_img":"https:\/\/eigene-homepage-erstellen.net\/wp-content\/uploads\/2019\/08\/oo-attribution-1-300x81.png","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/eigene-homepage-erstellen.net\/wp-content\/uploads\/2019\/08\/oo-attribution-1.png","tax_additional":{"categories":{"linked":["<a href=\"https:\/\/eigene-homepage-erstellen.net\/blog\/analytics\" class=\"advgb-post-tax-term\">Analytics<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">Analytics<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/eigene-homepage-erstellen.net\/blog\/analytics\" class=\"advgb-post-tax-term\">attribution<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">attribution<\/span>"]}},"comment_count":"15","relative_dates":{"created":"Posted 5 years ago","modified":"Updated 2 months ago"},"absolute_dates":{"created":"Posted on July 23, 2019","modified":"Updated on September 5, 2024"},"absolute_dates_time":{"created":"Posted on July 23, 2019 7:00 am","modified":"Updated on September 5, 2024 8:16 am"},"featured_img_caption":"","series_order":"","category_info":[{"taxonomy":"category","name":"Analytics","slug":"analytics","permalink":"https:\/\/eigene-homepage-erstellen.net\/blog\/analytics","icon":"https:\/\/eigene-homepage-erstellen.net\/wp-content\/uploads\/2021\/10\/analytics-category-icon.png","theme":"analytics"}],"author_info":{"first":"Michael","last":"Wiegand","url":"https:\/\/eigene-homepage-erstellen.net\/blog\/author\/mwiegand"},"_links":{"self":[{"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/posts\/49203"}],"collection":[{"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/users\/135"}],"replies":[{"embeddable":true,"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/comments?post=49203"}],"version-history":[{"count":0,"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/posts\/49203\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/media\/49213"}],"wp:attachment":[{"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/media?parent=49203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/categories?post=49203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/tags?post=49203"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/eigene-homepage-erstellen.net\/wp-json\/wp\/v2\/coauthors?post=49203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}