This feature is currently in beta.
This article covers some common Pixel implementation scenarios and is meant to be used as an example to aid in Pixel troubleshooting and installation.
Basic Steps
Implementing the Pixel Code:
-
Find the Website's Header: Identify the <head> section or the website's header file.
-
Paste the Code: Paste the copied pixel code into the header, usually just before the closing </head> tag.
-
Add Event and parameter Code: For specific pages where you want to track conversions, add the relevant event and parameter code; ensure the base code is always included.
-
Save Changes: Save the changes to your website's code.
Common Scenarios
|
Scenario |
Sample Code snippet |
|
One event on a page |
<script> (function(w, d){ var id='spdt-capture', n='script'; if (!d.getElementById(id)) { w.spdt = w.spdt || function() { (w.spdt.q = w.spdt.q || []).push(arguments); }; var e = d.createElement(n); e.id = id; e.async=1; e.src = 'https://pixel.byspotify.com/ping.min.js'; var s = d.getElementsByTagName(n)[0]; s.parentNode.insertBefore(e, s); } w.spdt('conf', { key: 'pixel-key' }); w.spdt('view'); })(window, document); </script> |
|
Multiple events on a page |
<script> (function(w, d){ var id='spdt-capture', n='script'; if (!d.getElementById(id)) { w.spdt = w.spdt || function() { (w.spdt.q = w.spdt.q || []).push(arguments); }; var e = d.createElement(n); e.id = id; e.async=1; e.src = 'https://pixel.byspotify.com/ping.min.js';; var s = d.getElementsByTagName(n)[0]; s.parentNode.insertBefore(e, s); } w.spdt('conf', { key: 'pixel-key' }); w.spdt('view') w.spdt('purchase'); })(window, document); </script> |
|
Params |
<script> (function(w, d){ var id='spdt-capture', n='script'; if (!d.getElementById(id)) { w.spdt = w.spdt || function() { (w.spdt.q = w.spdt.q || []).push(arguments); }; var e = d.createElement(n); e.id = id; e.async=1; e.src = 'https://pixel.byspotify.com/ping.min.js'; var s = d.getElementsByTagName(n)[0]; s.parentNode.insertBefore(e, s); } w.spdt('conf', { key: '0000000000000' }); w.spdt('lead', { category: 'Insurance Quote', // Dynamically populate from session data type: 'CAR', // Dynamically populate from session data value: '22.50', // Dynamically populate from session data currency: 'USD', }); })(window, document); </script> |
