I set the dataLayer variable with the post author, tags and categories data. All these were already created as custom dimensions on Analytics.
The problem is that Post Tags and Categories are arrays, Do I have to split the arrays on Google Tag Manager? (Or something like that, IDK). I did a test with Post Categories setting up pageCategory[0]
as Data Layer Variable Name (Because I need only the first category) but It's not working good.
The dataLayer looks like this:
{
"pagePostType":"post",
"pagePostType2":"single-post",
"pageCategory":["ha-kidd-knitting-supplies"],
"pageAttributes":["big-time-yarn","charles-voth","classic-shades","easy-knits","km066","knitted-cowl","textured-cowl","universal-yarn"],
"pagePostAuthor":"Charles Voth"
}
What is the best way to collect all the wordpress post tags and categories as custom dimensions on Analytics?