The following is a simple guide for installing the Podsights Pixel in Google Tag Manager.
Select Add New Tag in a workspace.
Select the “Custom HTML” tag type.
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>
Select the trigger to be “all page views” or any trigger you would like Podsights to track.
When you are done, the tag should have the final configuration.
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:
<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>
<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.