Tracking | How to Implement ChannelMix Conversion Tracking with Conversion ID

ChannelMix Conversion Tracking with Conversion ID requires Google Analytics custom events and a Google Analytics Conversion (a goal for Universal Analytics) to be implemented to support Multi-Touch Attribution and Pipeline Analytics dashboards. This document provides the specs needed to implement the required Google Analytics tracking code and administration setup on your website, Google Analytics and Google Tag Manager.

Prerequisites

The Website dataLayer Configuration (read more)

The dataLayer is a JavaScript object that is used by your website to pass data to Google Tag Manager. The following script will need to be executed when an important event happens on your website, e.g. a form is submitted with lead information.

In order for the Analytics and Marketing platforms to properly attribute traffic and sessions, a bridge between your CRM and the Analytics platform must be created. This connected data is the LEAD ID or CONFIRMATION ID generated by the website. ChannelMix tagging can generate the necessary ID to insert into your CRM system.

Complete the following steps:

  1. Add hidden input fields
  2. Create variables to support
  3. Create / place supporting scripts
  4. Create UA Event Tags
  5. Create Goals and Alerts

Input Tag Elements

First, add a HIDDEN input tag to all forms where you intend to count conversions. Add this field “cmx_id” to your CRM system as a key that is stored with all form submits. This data must be exportable with CRM data. Personally identifiable information (PII) is not necessary for export, only this ID.

<input type='hidden' name='channelmix_id' value='' >

Google Tag Manager - Supporting Variable and Script Configuration

ChannelMix Conversion ID Script Support

Second, add the following custom script via GTM to fire on all pages at DOM Ready. This will attempt to find the hidden cmx_id form tag and set its value.

<script>
  (function(c,m,x){
    var setCMXFormInput = function(cmx){
       cmx = 'input#' + cmx + ',input[name='+cmx+']';
       var cmx_input = document.querySelectorAll(cmx);
       if(cmx_input && cmx_input.length >= 1){
         for(i in cmx_input)
            cmx_input[i].value = '{{ChannelMix Conversion ID}}';
         console.info('ChannelMix Conversion ID Set!');
       }else{
         console.warn('ChannelMix Conversion ID NOT Set! - input not found');
       }
    };
    setCMXFormInput(m);
  })(window,'channelmix_id','');
</script>

Note! This will not work for an iFramed form. The form must be on the same document as the GTM snippet and dataLayer.

Requirements for ChannelMix Conversion ID:

5 variables in GTM:

  1. Visitor ID - the GA Client ID / User ID
  2. Session ID - the web platform session ID
  3. Session Hash - a unique ID generated for the current session
  4. Cookie - _ga - the Google Analytics Cookie ID
  5. ChannelMix Conversion ID variable

Session ID

Create the ChannelMix Session ID as a custom JavaScript variable, named exactly as: “Session ID”

function(){
var sess = sessionStorage.cmx_sessionid;

if(!sess || typeof sess == 'undefined'){
//create a new one, set it
sess = '{{Session Hash}}';
if(sessionStorage){
sessionStorage.setItem('cmx_sessionid', sess );
}
}
return sess;
}

Visitor ID

Create the variable for Visitor ID as a custom JavaScript variable, named exactly as: “Visitor ID”

function(){
var cmx_hash = "";
var chars = "-_.;!@%^*()=+~" + "0123456789" +
"abcdefghijklmnopqrstuvwxyz" +
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var length = 16;
for (var i = length; i > 0; --i)
cmx_hash += chars[Math.floor(Math.random() * chars.length)];
return cmx_hash;
}

GA Cookie

Create the variable for Cookie - _ga as a 1st Party Cookie variable, named exactly as: “Cookie - _ga“ with the cookie name as: _ga

ga_cookie_variable_configuration.png

ChannelMix Conversion ID

Create the ChannelMix Conversion ID variable. Set its type to “Data Layer Variable.”
Use the variable name: “channelmix_id

Set the Default Value to use the two previously created variables Visitor ID and Session ID, delimited by a dash.

channelmix_conversion_ID_variable.png

Conversion Success Script Tag

Last, on successful submission of any conversion form, fire the ChannelMix Conversion event. Place this Custom HTML tag via GTM to fire on successful form submission.

<script>
window.dataLayer.push({
     'event':'ChannelMix.conversion',         
      'conversionId': '{{ChannelMix - Conversion ID}}'
 });
</script>

* Forms that are hosted within an iFrame or on a separate domain will also need to have Google Tag Manager installed on the other domains to ensure proper tracking. If GTM cannot be added to the hosted frame, contact your Client Experience manager for tracking support. Provide any documentation of the frame’s platform or provider.

Trigger Configuration

Create a trigger named “ChannelMix Conversion” using the settings shown in the image below:
Event name: ChannelMix.conversion

trigger_configuration_settings.png

Google Tag Manager - Tag Configuration

A tag will need to be created in Google Tag Manager to send the information in the dataLayer to Google Analytics. Use the newly created ChannelMix.conversion trigger.

Tag Configuration

Create a Universal Analytics tag named “UA Event | ChannelMix Conversion” using the settings shown in the image below:

UA_tag_configuration.png

* Additional metadata can be collected using the Event Label. This type of tracking is considered custom to the website and therefore not included in this implementation guide e.g. {product}, {form_id}, etc. Talk to your client experience manager for more information!

Google Analytics Goal Configuration

Create a Goal named “ChannelMix Conversion” using the settings shown in the image below. The Goal should be configured to fire on the event that was set up to send to Google Analytics in the previous steps.

google_analytics_goal_configuration.png

Google Analytics Alert

In order to maintain quality of service, enabling a Google Analytics custom alert for this event will help notify key people in the event of website or app failure to report conversion. This can be set to an adjustable threshold.

  1. Visit the Google Analytics ADMIN panel by clicking the link in the LEFT side menu.
  2. Select the Universal Analytics reporting View.
  3. Under the “Personal tools and Assets” section, click “Custom Alerts.”

Alert Settings

Create a new alert named: ChannelMix Conversion - LOW COUNT

  1. Apply the Alert to all applicable reporting views
  2. Set the period frequency to DAY
  3. Check the Box for “Send me an email when this alert triggers”
  4. Also include the following email address: channelmixsupport@alightanalytics.com

Conditions

Apply this alert to ALL TRAFFIC and alert when “ChannelMix - Conversion” Goal is less than 0.5.

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.