ChannelMix Conversion ID Implementation Guide

Purpose & Introduction

The purpose of this article is to detail requirements for implementing ChannelMix Conversion ID. Whenever applicable, instructions are given for both Google Analytics 4 (GA4) and Universal Analytics (UA).

Difficulty: 79-799197_crossed-wrench-clipart.png

A developer may be required to implement a hidden input field on your website. 

What is ChannelMix Conversion ID? 

ChannelMix Conversion ID (CCID) is a unique identifier assigned to individual lead generation conversions. The ID is collected by both Google Analytics and CRM systems at the point of a conversion, allowing us to unify those separate data sets. 

Prerequisite

Implementation Steps in this Guide

1. Google Tag Manager (GTM) - variables and scripts to support ChannelMix Conversion ID

2. Google Analytics (GA) - Custom Dimensions

3. Website - hidden input field to receive the CCID as a form input

4. CRM - receive the CCID with each form submission

5. Validation 

Google Tag Manager

Google Tag Manager requirements:

  • Variables 
    • ChannelMix Hash
    • ChannelMix Session ID
    • ChannelMix Event ID
    • ChannelMix Conversion ID
  • Tags/Scripts  
    • ChannelMix Event ID Reset Script
    • CCID Hidden Input Support Script

Variables

The code snippets below should be implemented in GTM as custom JavaScript variables. For each variable, copy/paste the name and code verbatim. 

Custom_JS_Var.jpg

ChannelMix Hash 

function(){
  var cmx_hash = "";
  var chars = "0123456789" +
              "abcdefghijklmnopqrstuvwxyz" +
              "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
              // enable this to enable special chars 
             // "-_.;!@%^*()=+~"

  var length = 16;
 for (var i = length; i > 0; --i)
   cmx_hash += chars[Math.floor(Math.random() * chars.length)];

 return cmx_hash; 
}

ChannelMix Session ID

function(){
  var sess_id = sessionStorage.cmx_sessionid;

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

ChannelMix Event ID

function(){
  var event_id = sessionStorage.cmx_eventid;

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

ChannelMix Conversion ID - unlike the variables above, this one is a Data Layer Variable.

  • Data Layer Variable Name: "channelmix_conv_id"
  • Set Default Value: "{{ChannelMix Session ID}}-{{ChannelMix Event ID}}"
  • Set Convert null to, Convert undefined to both with the same variables: "{{ChannelMix Session ID}}-{{ChannelMix Event ID}}"

Tags

Tags below are shown with a Custom Event trigger that assumes data layer support has been implemented as detailed in this guide: ChannelMix Conversion Tracking (CCT) - Implementation Guide. Data layer support is considered best practice but the trigger(s) you use may vary based on your needs. 

Cleanup Tag: ChannelMix Event ID Reset Script

Copy/paste the following into a new Custom HTML tag. No trigger is required, this will be added a Clean Up tag for the Conversion tag. 

<script>
(function(){
//Create a new ChannelMix Event ID and store it
var eventid = {{ChannelMix Hash}}
if(sessionStorage){
sessionStorage.setItem('cmx_eventid', eventid );
}else{
console.warn('ChannelMix Event ID NOT Set!');
}
})()
</script>

Add the Cleanup Tag: Tag Configuration > Advanced Settings > Tag Sequencing > check Fire a tag after [ChannelMix Conversion tag] fires.

mceclip1.png

GA4 Event - ChannelMix Conversion

mceclip0.png

UA Event - ChannelMix Conversion

mceclip2.png

UA Event only - The Index value of your custom dimension above may differ depending on what is configured in Google Analytics (instructions in the next section). 

CCID Hidden Input Support Script - copy/paste the code below into a new Custom HTML tag.

<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_conv_id','');
</script>

Set the trigger to fire on all page views on DOM Ready. 

DOM_Ready.jpg

Hidden_Input_Support_Script.jpg

Google Analytics

Requirement: create a new custom dimension for ChannelMix Conversion ID.

GA4 - To update Custom Dimensions: navigate to Configure > Custom Definitions > Create custom dimensions

GA4_CD.jpg

UA - To update Custom Dimensions: navigate to Admin > Custom Definitions > Custom Dimensions

UA_CD.jpg

Website

Requirement: Add a hidden input field setting the name to exactly "channelmix_conv_id". This is the name the script will search for in order to set the value with the Conversion ID. This input may be added either through code or your form management system.

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

CRM

Requirement: Add a field to receive the CCID value the same way you would receive first and last name values. 

Validation

GTM Preview Validation

preview_button.jpg

  1. From the GTM container where you have implemented the Conversion Tag, click Preview in the top right to open the Tag Assistant tab.
  2. Enter the name of your site and click "Connect" to open a third tab previewing your implementation applied to your website.
  3. Connecting through Tag Assistant will open a third tab with your site. Use this tag to trigger a conversion through the required interactions with your website. 
  4. Return to your Tag Assistant tab and check the Conversion Tag for the ChannelMix Conversion ID.
  5. Click into the fired Conversion Tag and click Values instead of "Names" to see the values recorded.
  6. Ensure that the ChannelMix Conversion ID appears as expected. 

Tag_Assistant_Conversion_Event.jpg

GA4

GA4_Event_Tag_w_CCID.jpg

UA

UA_Event_Tag_w_CCID.jpg

 

GA Report Validation

GA4 - Click Reports > Realtime after triggering a conversion to ensure that the CCID value is recorded in GA. 

One of the tables within the Realtime report shows "Event count by Event name". Click the channelmix event then click into the Event Parameter channelmix_conv_id. You should be able to find the same CCID that was generated in your test conversion. 

Realtime_1.jpg Realtime_2.jpgRealtime_3.jpg

UA - Navigate to Reports > Behavior > Events > Top Events and search "channelmix". You should see a values reported for "Total Events" and "Unique Events". Add the ChannelMix Conversion ID as a custom dimension and ensure that values are reported. 

GA_UA_Report_CCID.jpg

Google Chrome DevTools Validation

  • After deploying your staged GTM Container changes in the previous step, open Chrome browser and navigate to your site to trigger the PageView Tag. 
  • Right-click anywhere on the page and choose "Inspect" from the menu to open Chrome DevTools.
    • Mac: Ctrl + Option + J 
    • Windows: Ctrl + Shift + J
  • Within DevTools, choose the Network tab.
  • Check "Preserve log" - you may need to do this before you trigger the conversion

GA4 Event - Search through the resultant requests and ensure that the ChannelMix Converision event fired. You should see "en: channelmix" in the list of Payload Query String Parameters. This represents the Event name set in GTM and validates that the event data was sent to GA. 

DevTools_CCID_GA4.jpg

 

UAEvent - you should be able to find a request where the query string parameters contain the correct values for "ec" and "ea" - these represent the Event Category and Event Action of the Conversion Tag. 

DevTools_CCID_UA.jpg

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.