Pinterest Pixel Setup in Adobe Launch for Button Clicks | Community
Skip to main content
March 1, 2023
Solved

Pinterest Pixel Setup in Adobe Launch for Button Clicks

  • March 1, 2023
  • 1 reply
  • 3001 views

Hi,

 

I am trying to set up a Pinterest Pixel to track when a specific button is clicked on the website. In the Launch Rule I've set it up as a core-click for the button and for the event action I have set it to custom code and under editor I'm using this script I got from the Pinterest Developer website.I have my Pinterest ID to put into the code I just left it out in the example below:

 

<script>
pintrk('track', 'custom');
</script>
<noscript>
<img
height="1"
width="1"
style="display:none;"
alt=""
src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&event=custom&noscript=1"
/>
</noscript> 

 

What else am I missing in order for the Pixel to fire correctly when the button is clicked?

 

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jennifer_Dungan

Do you have the base Pinterest Pixel script installed on the site?

 

 

I have Pinterest pixels installed on our sites entirely through Launch...

 

The first thing I have is:

!function(e){if(!window.pintrk){window.pintrk = function () { window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var n=window.pintrk;n.queue=[],n.version="3.0";var t=document.createElement("script");t.async=!0,t.src=e;var r=document.getElementsByTagName("script")[0]; r.parentNode.insertBefore(t,r)}}("https://s.pinimg.com/ct/core.js");

 

Basically, I first check if the pintrk object exists.. if not, I add the script to the site.

 

Next, now I have to run a config event (this happens on all pages)

// I have a variable set eaelier with my ID value, then so it's easier to adjust globally if needed pintrk('load', pinterestPixelId);

 

This now configures the pintrk object with our pinterest id

 

Now I fire our standard Page View event:

pintrk('page');

 

Once the above is all working, and you have a properly configured pintrk object, you should be able to fire pixels with your clicks... 

 

pintrk('track', 'custom');

 

There's not much need to code the noscript portion of the code... you are using JS to trigger all this.. if JS is disabled those no scripts won't be available either.

 

This is all assuming that you are doing ALL the Pinterest work in Launch.. if the Pinterest Script and Config is set up on the base code of your site you may not need all of this... 

 

Are you getting any errors?

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Jennifer_DunganCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
March 1, 2023

Do you have the base Pinterest Pixel script installed on the site?

 

 

I have Pinterest pixels installed on our sites entirely through Launch...

 

The first thing I have is:

!function(e){if(!window.pintrk){window.pintrk = function () { window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var n=window.pintrk;n.queue=[],n.version="3.0";var t=document.createElement("script");t.async=!0,t.src=e;var r=document.getElementsByTagName("script")[0]; r.parentNode.insertBefore(t,r)}}("https://s.pinimg.com/ct/core.js");

 

Basically, I first check if the pintrk object exists.. if not, I add the script to the site.

 

Next, now I have to run a config event (this happens on all pages)

// I have a variable set eaelier with my ID value, then so it's easier to adjust globally if needed pintrk('load', pinterestPixelId);

 

This now configures the pintrk object with our pinterest id

 

Now I fire our standard Page View event:

pintrk('page');

 

Once the above is all working, and you have a properly configured pintrk object, you should be able to fire pixels with your clicks... 

 

pintrk('track', 'custom');

 

There's not much need to code the noscript portion of the code... you are using JS to trigger all this.. if JS is disabled those no scripts won't be available either.

 

This is all assuming that you are doing ALL the Pinterest work in Launch.. if the Pinterest Script and Config is set up on the base code of your site you may not need all of this... 

 

Are you getting any errors?

svsvsvsvAuthor
March 8, 2023

Thank you so much for the detailed explanation! 

February 20, 2024

Ok, thanks. None of my Google searches returned this, all I found was the itemized list.

 

In this case, what is the exact value returned by _satellite.getVar('Transaction - CCRZ - SKU')

 

If your Data Element doesn't have the correct format, then it won't work... that Data Element must return values that look like:

['12345', '67890', '269356']

 

If it's not this exact format, that will most likely be your problem.

 

 

This is why I suggested using console.log in the script (above the Pinterest Code) to see exactly what value is being passed into Pinterest.

 

While you can run a direct call in your console after the fact, you might miss something, like maybe the IDs aren't set yet when this code runs, or it's been manipulated afterwards by other stuff happening during checkout.


Thankyou Jennifer, for the detailed explanation and now I'm able to get the values as expected.

Now, my only concern is around the "Product Category", in my snippet nowhere I've used it but somehow it is coming with the response.

var productInfo = []; var c = CCRZ.orderDetailView.model.attributes.orderItems; for (var i = 0; i < c.length; i++) { var product = { product_name: c[i].productR?.sfdcName, product_id: c[i].productR?.SKU, product_price: c[i].itemTotal, product_quantity: c[i].quantity}; productInfo.push(product); } pintrk('track', 'checkout', { value: _satellite.getVar('Transaction - CCRZ - Total Amount'), order_quantity: _satellite.getVar('Transaction - CCRZ - Qty'), currency: _satellite.getVar('Transaction - CCRZ - Currceny'), order_id: _satellite.getVar('Transaction - CCRZ - Order ID'), line_items: productInfo });

 looking forward for your replies.