How To Change the Property Name of Objects inside ecommerce.products Array
-
Hello, I am using the GTM4WP to implement Pinterest tags for my website. I am sending an array of line_items to Pinterest when a customer checks out.
The issue I am having is that Pinterest is not able to read the “id” and “category” properties for each item in the array because the property name has to be “product_id” and “product_category”. So currently the Product ID and Product Category come up as missing on Pinterest.
Is there a way to change the names so that id = product_id and category = product_category? An example of how I want it is below. Thank you.
products: [
{
product_id: 1494,
name: ‘Blank Plain Tee – Men’s Clothing Crew Neck T-Shirt’,
sku: ‘CN-MEN-STAND-PLAIN-SM’,
product_category: ‘T-Shirts’,
price: 10.99,
stocklevel: null,
variant: ‘Small’,
quantity: 1
}
]
- The topic ‘How To Change the Property Name of Objects inside ecommerce.products Array’ is closed to new replies.