Installing the Podsights Pixel with Google Tag Manager

The following is a simple guide for installing the Podsights Pixel in Google Tag Manager.

Step By Step

Step 1

Select Add New Tag in a workspace.

Add New Tag

Step 2

Select the “Custom HTML” tag type.

Add Custom Html

Step 3

Copy and paste the script tag into the custom HTML box. Note, please make sure you have entered the right pixel ID where you see “Your Pixel ID”.

<script>
  // install.
  (function(w, d){
  var id='pdst-capture', n = 'script';
  if (!d.getElementById(id)){
    w.pdst = w.pdst || function() {(w.pdst.q = w.pdst.q || []).push(arguments);};
    var e = d.createElement(n); e.id = id; e.async=1;
    e.src = 'https://cdn.pdst.fm/ping.min.js';
    var s = d.getElementsByTagName(n)[0];
    s.parentNode.insertBefore(e, s);
  }
  w.pdst('conf', { key: 'Your Pixel ID' });
  w.pdst('view');
  })(window, document);
</script>
Add Custom Html

Step 4

Select the trigger to be “all page views” or any trigger you would like Podsights to track.

Add Custom Html

Final

When you are done, the tag should have the final configuration.

Add Custom Html

Events

Podsights needs the install script with every fire of Podsights pixel. If you would like to use conversion events like lead and purchase you will need to include the full script before calling pdst('{action}', {options}) like so:

Lead Event

<script>
  // install.
  (function(w, d){
  var id='pdst-capture', n = 'script';
  if (!d.getElementById(id)){
    w.pdst = w.pdst || function() {(w.pdst.q = w.pdst.q || []).push(arguments);};
    var e = d.createElement(n); e.id = id; e.async=1;
    e.src = 'https://cdn.pdst.fm/ping.min.js';
    var s = d.getElementsByTagName(n)[0];
    s.parentNode.insertBefore(e, s);
  }
  w.pdst('conf', { key: 'Your Pixel ID' });
  })(window, document);

  // Call lead.
  pdst('lead', {
    type: "Sign Up",
    category: "Life Insurance"
  });
</script>

Purchase Event

<script>
  // install.
  (function(w, d){
  var id='pdst-capture', n = 'script';
  if (!d.getElementById(id)){
    w.pdst = w.pdst || function() {(w.pdst.q = w.pdst.q || []).push(arguments);};
    var e = d.createElement(n); e.id = id; e.async=1;
    e.src = 'https://cdn.pdst.fm/ping.min.js';
    var s = d.getElementsByTagName(n)[0];
    s.parentNode.insertBefore(e, s);
  }
  w.pdst('conf', { key: 'Your Pixel ID' });
  })(window, document);

  // Purchase call. If you have set up GTM variables you should use them here.
  pdst('purchase', {
    value: {{gtm_purchase_value_variable}},
    currency: "USD",
    order_id: {{gtm_purchase_order_id_variable}}
  });
</script>

Note that the install script will only run once, even if it’s called multiple times.