• Resolved lindagallenberger

    (@lindagallenberger)


    Hey,
    unfortunately I am always getting a huge error message, when trying to install the Pinterest tag via code snippets on my website.
    It may well be that I am doing something wrong / not setting it up correctly, so it would be great to have some guidance. Unfortunately, I can not find anything online.
    Is there somewhere a description/Tutorial how to include the Pinterest tag with code snippets in the header of the website?
    Thanks already!
    Best regards,
    Linda

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi @lindagallenberger,

    Can you provide an example of the code you are trying to add?

    Thread Starter lindagallenberger

    (@lindagallenberger)

    Hey @bungeshea,
    sure, this is an example of how such a Pinterest tag looks like.

    Plugin Author Shea Bunge

    (@bungeshea)

    Hi @lindagallenberger,

    If you have Code Snippets Pro, you can add this as a Content (HTML) snippet:

    Make sure to select ‘Display in site <head> section’.

    Alternatively, if you’re using the free version of Code Snippets, you can add it as a Functions (PHP) snippet with an action hook wrapper:

    add_action( 'wp_head', function () { ?>
    
    <!-- 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', '[YOUR_ID_GOES_HERE]', {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=[YOUR_ID_GOES_HERE]&pd[em]=<hashed_email_address>&noscript=1" />
    </noscript>
    <!-- end Pinterest Tag -->
    
    <?php } );
    Thread Starter lindagallenberger

    (@lindagallenberger)

    Hi @bungeshea,
    Thanks so much! That helped a lot 🙂

    Plugin Author Shea Bunge

    (@bungeshea)

    No worries!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Installing the Pinterest Tag using Code Snippets’ is closed to new replies.