The problem/question I have is that when one of those query parameters are not present, the classification rule will not run correctly because it needs to look for all 5 in order to run successfully (it looks for each of those 5 "sections" that are separated by the period and when one is not present, it breaks). Is there a processing rule I can create or a change in the classification rule that I can create in order to account for any of the missing UTM params so it eventually does get classified (essentially I have been trying to fill the missing UTM param(s) with a "null" or "does not exist" type of terminology)? Or are there any other solutions that may work?
I think you cant fix it within your regex since you don't know which parameter is missing.
best way to fix
always use all parameters in tracking url (it works if maybe the last is missing, but the first 4 need to be present)
fix DTM to handle missing parameters, eg. replace by "none"
fix by processing rules
Maybe I can give you a solution with processing rules. I haven't used it so carefully test it before overwriting your original "campaign" variable!
Rule 1: set 5 free props to "none"
overwrite value "prop1" with custom value "none"
overwrite value "prop5" with custom value "none"
Rule 2: overwrite props with parameter value (if set)
overwrite value "prop1" with query string parameter "utm_source" (add condition: query string parameter "utm_source" is set)
overwrite value "prop5" with query string parameter "utm_term" (add condition: query string parameter "utm_term" is set)
Rule 3: overwrite "campaign" variable (if set)
condition: "campaign" is set
overwrite "campaign" with concatenated value (parameter '.') => add all props from before
How it works: basically you use 5 props as temporary savings and first set them all to "none". after this you replace the default value of your props by the corresponding utm-parameter, but only if the exists. so every prop has either "none" or the value of the parameter.
at the end you concatenate all 5 props to a single string and replace the "campaign" variable.
since I haven't tested it I strongly recommend that you first save your final string in another prop. this way you can compare the single props and the concatenated value in the database. do some testings and see if all combinations work as expected.
let me know if it works, might submit this as my next "rockstar idea" ericmatisoff
To answer you, it would come in as "b". If one or more parameters are missing, it would look like this: fakesource.fakemedium.
Sometimes they are all set, sometimes one is missing, sometimes three are missing, etc. I am looking for a solution to account for all scenarios.
Something along the lines of IF medium, source, content are present AND campaign, term are not, then set campain and term to null (that would be one scenario of many, obviously there could be many different combos).
The current RegEx we use is as follows: ^(.+)\.(.+)\.(.+)\.(.+)\.(.+)$
I'm not a regex expert, but would anyone know how to adjust that so it would take into account values that are not present and marking it as "null"?