Tracking | CCID 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: 
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
- Google Tag Manager (GTM) - variables and scripts to support ChannelMix Conversion ID
- Google Analytics (GA) - Custom Dimensions
- Website - hidden input field to receive the CCID as a form input
- CRM - receive the CCID with each form submission
- Validation
Google Tag Manager
Note: This section provides instruction which persist CCID via browser Session Storage. For instructions to persist CCID via cookie, replace the following GTM instructions with the instructions in this guide, then return to this guide and complete the remaining requirements.
Google Tag Manager requirements:
- Variables
- ChannelMix Hash
- ChannelMix Session ID
- ChannelMix Event ID
- ChannelMix Conversion ID
- Tags/Scripts
- CCID 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.
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
CCID 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.
GA4 Event - ChannelMix Conversion
UA Event - ChannelMix Conversion
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.
Requirement: create a new custom dimension for ChannelMix Conversion ID.
GA4
To update Custom Dimensions: navigate to Configure > Custom Definitions > Create custom dimensions
UA
To update Custom Dimensions: navigate to Admin > Custom Definitions > Custom Dimensions
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
- From the GTM container where you have implemented the Conversion Tag, click Preview in the top right to open the Tag Assistant tab.
- Enter the name of your site and click "Connect" to open a third tab previewing your implementation applied to your website.
- 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.
- Return to your Tag Assistant tab and check the Conversion Tag for the ChannelMix Conversion ID.
- Click into the fired Conversion Tag and click Values instead of "Names" to see the values recorded.
- Ensure that the ChannelMix Conversion ID appears as expected.
GA4
UA
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.
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.
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.
UA Event
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.