Rodrigo Paulino
Rodrigo Paulino

Reputation: 89

Google Tag Manager - Product with multiple categories

I'm developing a tag, but the product, wines, has 5 categories, like country, region, type of grape, etc... However, the dataLayer contains a slot for only 1 category.

'transactionProducts': [{ 'sku': 'DD44', 'name': 'T-Shirt', 'category': 'Apparel', 'price': 11.99, 'quantity': 1 }]

I need this:

'transactionProducts': [{ 'sku': 'DD44', 'name': 'T-Shirt', 'category': ['Category 1','Category 2','Category 3'], 'price': 11.99, 'quantity': 1 }]

Is possible? Works correctly?

Upvotes: 2

Views: 1236

Answers (1)

nyuen
nyuen

Reputation: 8907

Putting the categories into an array won't work as the field only accepts a single string. You can use a pipe (or anything)-delimited string instead:

'category': 'Category 1|Category 2|Category 3',

Upvotes: 2

Related Questions