Facebook + Pinterest Pixel

If I want to embed the Facebook pixel or the Pinterest pixel in the tag manager using custom HTML. Matomo won’t let me save this.

I was able to do the Facebook pixel using the template, but the Pinterest pixel doesn’t allow it.

How do you do this?

Current Matomo with PHP 7.4

Just wanted to work around it and include Pinterest’s pixel code as a variable in the tag.
Unfortunately, Matomo also stops here and says:


How else could you solve it except to move everything to the GTM

Do you have some doc (form Pinterest) about Pinterest’s pixel code?
How did you try to configure the variable/trigger/tag in the MTM for Pinterest’s pixel code?

Well as I said in the tag as custom HTML and as a variable so constant.

Unfortunately, both cannot be saved

Attached is a picture from the Pinterest page

With an MTM tag of type Custom Image (and with a previously define MTM variable tidVariableYouDefinedInMtm):

Configure what this tag should do

https://ct.pinterest.com/v3/?event=init&tid={{tidVariableYouDefinedInMtm}}&pd[em]=hashedemailaddress&noscript=1

Thanks for your help if I install all this then it can also be saved in Matomo.

So when I take out the I can save it.

Original

<!-- Pinterest Tag -->
<script>
!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");
pintrk('load', '{{VAR_Pinterest-Konstante}}', {em: '<user_email_address>'});
pintrk('page');
</script>
<noscript>
<img height="1" width="1" style="display:none;" alt=""
  src="https://ct.pinterest.com/v3/?event=init&tid={{VAR_Pinterest-Konstante}}&pd[em]=<hashed_email_address>&noscript=1" />
</noscript>
<!-- end Pinterest Tag -->

that can also be saved

<!-- Pinterest Tag -->
!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");
pintrk('load', '{{VAR_Pinterest-Konstante}}', {em: '<user_email_address>'});
pintrk('page');
<!-- end Pinterest Tag -->

that can also be saved

<!-- Pinterest Tag -->
!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");
pintrk('load', '{{VAR_Pinterest-Konstante}}', {em: '<user_email_address>'});
pintrk('page');
<noscript>
<img height="1" width="1" style="display:none;" alt=""
  src="https://ct.pinterest.com/v3/?event=init&tid={{VAR_Pinterest-Konstante}}&pd[em]=<hashed_email_address>&noscript=1" />
</noscript>
<!-- end Pinterest Tag -->

But it makes no sense if I leave out the HTML tags for script

→ Right: The 2 last portions of code are not valid, as <script> tags are missing…

Maybe try change {{VAR_Pinterest-Konstante}} into MatomoTagManager.dataLayer.values['VAR_Pinterest-Konstante']… ?

I also hope there is no special char (quotes, less-than, etc.) in the value of VAR_Pinterest-Konstante, and also for <user_email_address>