Is it possible to send data that are not strings?

Hi, I’m not so familiar with Piwik Pro. But my responsibility in a current project is pushing data layers to Piwik Pro from the front-end, which the marketing team takes care of.

I got notified that one of the data layers, does not show data for a key filters. I’ve made a dummy example below. So what we send out is an object containing different array values. Are both objects and arrays not allowed within a data layer? Is there a way to read this in correctly in Piwik Pro?

DataLayer.push({
    "event" : "example",
    "filters": {
        "colors": ["red", "blue"],
        "sizes": ["m"]
     }
...
});

I’ve currently updated it to the following, it’s however less readable, and in reality there’s way more filters, so it get’s quite tricky.

DataLayer.push({
    "event" : "example",
    "filterColors": "(2): red, blue",
    "filterSizes": "(1): m",
...
});

Hi @SarahVanDenBerghe,

Could you elaborate on what you mean by that part?

image

Seems to be picked up in the tag manager debugger:
image

This is part of the screenshot that was provided, everything else shows up, except for filtersInput (which is what I called filters in the dummy code). I’m unsure wether the tool represents Piwik Pro, or another tool such as Looker Studio handling the data from Piwik Pro.

The only difference being filtersInput and the other data that did work, is that filtersInput was not a string. However, debugging the code in my console does correctly show the object with arrays being send to Piwik Pro. So I’m not sure if either the object is not being accepted by Piwik and thrown out, or if our marketing team should handle the value differently due to it being an object.

I am not familiar with Piwik Pro itself, I don’t expect necessarily a solution to this problem, but just knowing where it goes wrong would be helpful to report back to the team. :blush:

Ah, so it’s likely that the whole filters object is pushed to the custom dimension it seems :thinking: .

Yeah, it’s from Piwik PRO reporting.

Would it be possible to get the site URL on which this is implemented? You can send me the details here or in a private message.

Thank you for helping out, I’ll send you a private message with the details!

So from what I can see this is how the DL variable (the one defined in Piwik PRO) looks like:
filtersInput[1][]

My question is - would you simply like to capture the “colors” variable as a single string and then add it to a custom dimension?