DataLayer for Google Tag Manager
How To Configure
DataLayer for Google Tag Manager

Integrate Pinterest Conversion Pixel with Google Tag Manager

Please Note: The settings below require our Datalayer for Google Tag Manager for Magento and some features also require our Enhanced Ecommerce extension.

Product Page View
Tag Configuration
  Tag type : Custom Html

Trigger Configuration
  Trigger: All Custom Events
  Event Name : productPage

HTML

<script>
require(['DataLayerApi'], function (dataLayerApi) {
    var dataHelper = dataLayerApi();
    
    <!-- Pinterest Conversion Tag Code -->
    pintrk('track', 'PageVisit', {});
    <!-- End Pinterest Conversion Tag Code -->
});
</script>
Add To Cart
Tag Configuration
  Tag type : Custom Html

Trigger Configuration
  Trigger: All Custom Events
  Event Name : addToCart

HTML

<script>
require(['DataLayerProductApi'], function (dataLayerProductApi) {
    var product = dataLayerProductApi();
    
    <!-- Pinterest Conversion Tag Code -->      
    pintrk('track', 'AddToCart', {
        value: product.getAddedToCartTotal(),
        order_quantity: product.getAddedToCartQty(),
        currency: product.getCurrencyCode()
    });
    <!-- End Pinterest Conversion Tag Code -->
});
</script>

*Enhanced Ecommerce extension required for this functionality.

Purchase
Tag Configuration
  Tag type : Custom Html

Trigger Configuration
  Trigger: All Custom Events
  Event Name : purchase

HTML

<script>
require(['DataLayerPurchaseApi'], function (dataLayerPurchaseApi) {
    var purchase = dataLayerPurchaseApi();

    <!-- Pinterest Conversion Tag Code -->
    pintrk('track', 'checkout', {
        value: purchase.getOrderTotal(),
        order_quantity: purchase.getItemCount(),
        currency: purchase.getCurrencyCode(),
        line_items: purchase.getPinterestItems()
    });
    <!-- End Pinterest Conversion Tag Code -->
});
</script>

FAQs

Q: How to check if my base code and event codes are firing after adding to my site?

A: ​Your base code is correctly implemented if the tag shows a ‘verified’ status in the conversion manager. Click into your Pinterest Conversion Tag to check that your event codes are firing - you’ll see a dashboard on the right for Tag Event History. Here you can see all the events that have fired with your Pinterest Conversion Tag. You can check when Pinterest last saw the event fire, and how many raw pixels fired for the event in the past 24 hours.

Q: Do I still need to add the base code, on pages where I want to track an event?

A: ​Yes. You need base code on every page where event code is added. On pages where you want to track conversions you should have two tags, the base code and the event code. See section 4 for examples of base plus event code. Keep in mind your base code must run first before the event code runs.

Related

Related Extensions

Get more from your Magento2 store!

HTML Minifier for Magento2

Minification is the process of removing all unnecessary characters and spacing from your source code without changing its functionality.

Enhanced Transactional Emails

Get more from your order confirmation emails by promoting other complementary products.

DataLayer for Tag Manager

Whether you are integrating Bing, Facebook, SnapChat, Pinterest, or any other services our extension make it easy.