Extractor in Custom Dimensions
Extractors are a way to help you automatically extract values from dimension with the help of functions on Clarisights. These functions will run across all available dimensions in the extractor expression. You can additionally customise the extractor to run on certain values by adding a rule-filter.
Let’s consider an example where campaigns are named as sem_india_M_25 or sem_australia_F_26 and you want to fetch name of the country from these campaigns, you can use the #SPLIT extractor command to get the name of the country. #SPLIT ( #DIM(CAMPAIGN), '_', 1) would result in india and australia respectively.
Functions
There are six functions supported on the platform currently.
In order to define the dimension, make sure you add DIM in front of all dimensions you will be using in the formulas.
#EXTRACT : Returns a segment between the first prefix and suffix #EXTRACT (string, prefix_string, suffix_string)
Example: For Campaign, dis_reach_web_[FI_ALL_XX_[RR]_[ST]_GELA_NFA_LPA , the extractor expression, #EXTRACT(#DIM(CAMPAIGN), “[”, “]”) will result to FI_ALL_XX_[RR
#SPLIT : Returns the nth occurrence of a segment of a string divided around a specified character/string. n starts from 0. #SPLIT(string, delimiter, occurrence_number)
Example: For Account, 10_network_ios , the extractor expression, #SPLIT(#DIM(ACCOUNT), “_”, 2) will result to ios
#SUB : Returns a segment of a string between specified index. Index starts from 0, and both starting index and ending index are included in the extracted segment. #SUB (string, starting_index, ending_index)
Example: For Campaign, Promo_Instagram_Engagement , the extractor expression, #SUB(#DIM(CAMPAIGN), 0, 4) will result to Promo
#CONCAT : Returns the concatenation of strings. #CONCAT (string 1, string 2, string 3, ..., string n)
Example: For Campaign and Account, namely - ios_br and Europe #CONCAT(#DIM(CAMPAIGN), #ACCOUNT) will result to ios_brEurope
#STRREPLACE : Replace strings based one the defined logic. #STRREPLACE (#DIM(dimension), string_to_replace, replacement)
Example: You would like to replace the parts of Campaign with a different dimension.
#LEN : Returns the length of strings. #LEN(DIM(string_1)) The LEN function can be used as an input to other extractor functions, but not by itself.
Example: For Campaign #LEN(#CAMPAIGN) will result to 7.
Advanced use cases
You could use a combination of extractor functions. For example:
#SPLIT(#EXTRACT(#DIM(CAMPAIGN), “web_”, “_GELA”), “[“, 0) . Campaign, dis_reach_web_[FI_ALL_XX_[RR]_[ST]_GELA_NFA_LPA will result to FI_ALL_XX_ .
Steps for setting up Extractor Expressions
Click on the Edit button to get inside the modal window to view or add or update rules and values.
Click on + New Value followed by clicking on Extract Values to start defining the functions and dimensions on which these functions would run.
Start by typing out # + any of the extractor functions above.
You would also see the expected values for these functions.
Enter the Extractor Expression
Select Channels to proceed
Please note that the list of channels displayed in have been filtered for those that have the specified dimension.
Click on Extract Sample Values to view resulting values from a sample size selected
Save the changes by clicking on Save Extractor