Concatenate existing dimensions to create new custom dimension

Hi all,

So we have a working, custom dimension called “ISP” which we reference in conjunction with Piwik’s native Provider and Organization dimensions to identify internal vs. external traffic. Using all three gives us the most complete picture, but it also entails a whole lot of repeated and/or conditional rules any time we’d like to create a new segment or filters to cover all three potential value sources.

Creating a new dimension that is simply a concatenation of the values recorded for each of the three dimensions seems like it would simplify such a process quite a bit. I began trying to leverage Tag Manager to generate the concatenated value of the new, prospective Custom Dimension, before realizing (a) that Location-category dimensional values don’t seem to be available at the time a Custom JS-type variable runs; and (b) that there seem to be some limitations when it comes to accessing data layer variables (“ISP” in our case), which may or may not be a relevant factor here.

Could you help guide me in the right direction, given the goal here? Is this possible via Tag Manager, or does this require some other approach? To reiterate, basically we’re just looking for the result of something like the below to be recorded as a dimension/value we could report on and leverage as needed:

function() {
  return {{ISP}} + ' || ' + {{Provider}} + ' || ' + {{Organization}}}; 
}

Hi @jsteckler,

Not sure if I understood you correctly but it seems to me that you would like to create your own metric to have possibility to use it in your reports? If so, please take a look at this article: Create your own calculated metrics | Piwik PRO help center

It gives you possibility to create your own calculted metric. Please let me know if that was the case

Hi @Adam,

Thanks so much for taking the time to take a crack at this — I really appreciate it.

I’m pretty sure you understand me correctly conceptually. What I have in mind (or had hoped) is definitely similar in nature to Piwik’s “Calculated Metrics” feature. But as far as I can tell, calculated metrics can only leverage mathematical formulas to manipulate numeric-based dimensional values.

In my case, I’m looking to combine three text-based dimensional values into a single dimensional value. The goal is to greatly reduce the number of redundant conditional filters I’m presently forced to apply to ensure the values that I’m looking to exclude — which can be found in any combination of the three fields for a given session, but never all three — are totally accounted for.

It’s programmatically very simple in theory but, as I understand it, there’s no way for Tag Manager to access the server-side values captured by Piwik’s Location or Organization field.

If “Calculated Metrics” supported a string or text formatting-type option, that would do the trick. Unfortunately, the only options offered there are number, time, percentage or currency.

That clear things up? Happy to be told I’m missing something obvious. Also happy to further clarify my objective if I can.

Thanks again, man!

Hi @jsteckler,

I think I know your needs know. Unfortunately, values like location or organization can’t be accessed from the Tag manager point of view, here is the list of built in variables we can access:

However, if you would like to get value from custom dimension you can use getCustomDimensionValue function and based on its value create a new one. You just need to keep in mind that you should get the value of custom dimension within specific event to get the value you need.

Hope my hints will help you