Skip to content

Instantly share code, notes, and snippets.

@33sticks
Last active April 18, 2016 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 33sticks/65df4ed58b82f0af5ec1 to your computer and use it in GitHub Desktop.
Save 33sticks/65df4ed58b82f0af5ec1 to your computer and use it in GitHub Desktop.
A template to manage marketing tags/pixels in DTM with a date comparison to kill pixels that are outside of campaign flight dates.
//ACTION REQUIRED: TAG CONFIGURATION
var killDate = new Date("MM/DD/YYYY"); //INPUT CAMPAIGN END DATE
var vendorName = ""; //INPUT NAME OF MARKETING VENDOR
var requestNum = ""; //INPUT TRACKING REQUEST NUMBER
var tagName = ""; //INPUT NAME OF TAG/PIXEL
//Get current date and remove hours
var todaysDate = new Date();
todaysDate.setHours(0,0,0,0);
killDate.setHours(0,0,0,0);
//Date check condition, tag only fires if the killDate is in the future
if (todaysDate <= killDate){
//ACTION REQUIRED: INSERT MARKETING TAG HERE
//END MARKETING TAG
_satellite.notify(tagName + " tag (Request Number: " + requestNum + ") fired.",1);
}else {
_satellite.notify(tagName + " tag (Request Number: " + requestNum + ") has expired. Please remove from Adobe DTM.",4);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment