Articles on: Client Side

Create Pinterest Line Items Variable

To send product data from eCommerce events to Pinterest, you need to create a variable that retrieves the relevant information from the DataLayer. The DataLayer contains important details about user interactions, such as the products they view, add to their cart, or purchase. By setting up a variable in your Google Tag Manager, you can extract this data and send it to Pinterest.

Let’s get started 🚀

While creating the Pinterest Line Item Variable, paste the following script into the input field so that product data from the DataLayer is processed and formatted into a structure that Pinterest can use for accurate tracking and analytics.

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  
  }  
});  
}


In this demo, we will show you how to create a Pinterest Line Item Variable.

Updated on: 15/01/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!