HomeAdobe Analytics

Classify Tracking Code using Rule Builder

Like Tweet Pin it Share Share Email

Well explained on Guide to Using UTM Parameters in Adobe Analytics

I used following code to capture Tracking code:

s.usePlugins=true;
s.doPlugins=function(s) {

if(s.Util.getQueryParam(‘utm_medium’)){
s.campaign=s.Util.getQueryParam(‘utm_medium’)+”:”+s.Util.getQueryParam(‘utm_source’)+”:”+s.Util.getQueryParam(‘utm_campaign’)+”:”+s.Util.getQueryParam(‘utm_content’)+”:”+s.Util.getQueryParam(‘utm_term’);
}
s.campaign=s.getValOnce(s.campaign,’s_campaign’,0);

}

Then I set up the calssification in Analytics

Below is the screen shot:

Then under classification rule builder I did following setup using regx ^(.+)\:(.+)\:(.+)\:(.+)\:(.+)$

Sample value:

search:google:christmas:article:gifts

The above regex will not accept value if any one of the field is missing like search:google:christmas::gifts or :google:christmas::gifts

To fix this we have to use : ^(.*)\:(.*)\:(.*)\:(.*)\:(.*)$

For reference check Adobe Doc

For example the value is our:DC_DAGA_November_2020::adobemailing:marketin:0 then you can use the following as well:

^([^:]):([^:]):([^:]):([^:]):([^:]):([^:])$

For testing, you can use https://rubular.com/

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.