Observe the Target Node Mutations (DOM)

// Options for the observer (which mutations to observe) const config = { attributes: true, childList: true, characterData: true, subtree: true, }; // Callback function to execute when mutations are observed const callback = (mutationList, observer) => { for (const…Continue reading

Goal Tracking Pixel

var peGoal = { name : “Enter goal name”, count: 1, value: 1, // Enter goal value in numbers }; window.PushEngage = window.PushEngage || []; PushEngage.push(function() { PushEngage.sendGoal(peGoal).then(function(data) { console.log(data) }).catch(function error(error) { console.log(error.message) }); });Continue reading

Add Profile ID to Subscriber

var peProfileId = “Enter Profile Id”; window.PushEngage = window.PushEngage || []; PushEngage.push(function () { PushEngage.setProfileId(peProfileId) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error.message, error.details); }); });Continue reading

Remove Subscriber from Segment

var peRemoveSegmentNames = []; // Array of segment ids e.g, [“segment1”, “segment2”] window.PushEngage = window.PushEngage || []; PushEngage.push(function () { PushEngage.removeSegment(peRemoveSegmentNames) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error.message, error.details); }); });Continue reading

Add Subscriber to Segment with Duration

var peSegmentNameWithDuration = []; // e.g, [{“name”:”segmentName”,”duration”: 5}] window.PushEngage = window.PushEngage || []; PushEngage.push(function() { PushEngage.addSegmentWithDuration(peSegmentNameWithDuration).then(function(data) { console.log(data) }).catch(function error(error) { console.log(error.message) }); });Continue reading

Add Subscriber to Segment

var peSegmentNames = []; // Array of segment ids e.g, [“segment1”, “segment2”] window.PushEngage = window.PushEngage || []; PushEngage.push(function() { PushEngage.addSegment(peSegmentNames).then(function(data) { console.log(data) }).catch(function error(error) { console.log(error.message) }); })Continue reading

Vertically center Instagram caption on hover

jQuery(window).on(‘sbiafterimagesloaded’, function (event) { $ = jQuery; $(‘.sbi_hover_top’).each(function(){ var $self = $(this); $self.css({ ‘position’ : ‘absolute’, ‘top’ : ( $self.parent().height() – $self.height() ) / 2 }); }); })Continue reading