Please Note: The settings below require our Datalayer for Google Tag Manager for Magento and some features also require our Enhanced Ecommerce or Google Analytics 4 extensions.
Tag Configuration
Tag type : Custom Html
Trigger Configuration
Trigger: All Custom Events
Event Name : productPage
HTML
<script>
require(['DataLayerProductApi'], function (dataLayerProductApi) {
var product = dataLayerProductApi();
<!-- Pinterest Conversion Tag Code -->
pintrk('track', 'PageVisit', {
currency: product.getCurrencyCode(),
product_id: product.getProductSkus()
});
<!-- End Pinterest Conversion Tag Code -->
});
</script>
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(),
product_id: product.getAddedToCartItemSkus()
});
<!-- End Pinterest Conversion Tag Code -->
});
</script>
*Enhanced Ecommerce and/or Ga4 extension required for this functionality.
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>
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.
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.
If your are using Magento + Google Analytics, then you need Enhanced E-commerce for Google Tag Manager.
Get more from your order confirmation emails by promoting other complementary products.