Classify Tracking Code using Rule Builder

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 testing, you can use https://rubular.com/

Leave a Reply

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