Articles on: Client Side

Create Pinterest Line Items Variable

To send the product data from the eCommerce events to Pinterest, you can create a variable that retrieves this data from the DataLayer.

Create a new variable
Select Custom Javascript as variable config
Paste the following script in the input field:

function() {
 var products = {{DLV - ecommerce items}};

 return products.map(function(product) {
   return {
     'product_name': product.item_name,
     'product_variant': product.item_variant,
     'product_id': product.item_id,
     'product_category': product.item_category,
     'product_brand': product.item_brand,
     'product_price': product.price,
     'product_quantity': product.quantity
   }
 });
}


Give the variable the name "Pinterest Line Items" and save

Updated on: 16/08/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!