Deploying your tag (code snippet)
Example Tag
<script>
(function() {
var w = window, d = document;
var s = d.createElement('script'); s.async = 1;
s.src = '//js.pulseinsights.com/surveys.js';
var f = d.getElementsByTagName('script')[0];
f.parentNode.insertBefore(s, f);
class PulseInsightsCommands extends Array{
push(...commands) {
commands.forEach((command) => window.PulseInsightsObject.processCommand(command));
}
}
function waitPulseInsightsObject() {
const timeoutPromise = new Promise((_, reject) => setTimeout(reject, 5000));
const waitPromise = new Promise(function (resolve) {
function wait() {
if (typeof window.PulseInsightsObject == 'object') {
resolve();
} else {
setTimeout(wait, 100);
}
}
wait();
});
return Promise.race([timeoutPromise, waitPromise])
}
waitPulseInsightsObject().then(function () {
w['pi']=function() {
w['pi'].commands = w['pi'].commands || new PulseInsightsCommands;
w['pi'].commands.push(arguments);
};
pi('host', 'survey.pulseinsights.com');
pi('identify', 'PI-99999999); // This is an example value.
pi('pushBeforeGet', true);
pi('get', 'surveys');
})
.catch(function() {
console.error('Failed to initialize window.PulseInsightsObject');
});
})();
</script>What the tag does
Finding your specific tag

Tag Deployment FAQs
Which pages should have the Pulse Insights code snippet?
Where on the page should we place the code snippet?
Can we use a tag manager to deploy Pulse Insights?
Does the Pulse Insights tag work with [X] CMS?
Do we use the same code snippet across secure/non-secure pages?
Do we use the same tag across multiple domains and subdomains?
Do we use the same tag across our development, staging, and production environments?
Last updated