This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
New Relic GPT ad monitoring code | |
// | |
This snippet captures PageActions containing references to Google publisher tag ads | |
Should you have any questions about this, please reach out to me at [email protected] | |
Please note that you must be using New Relic's SPA browser agent. | |
// | |
*/ | |
// | |
//first, make sure the newrelic object exists properly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nr_monitor_ads = function(){ | |
var convertToString = ['advertiserId', 'campaignId', 'creativeId', 'lineItemId', 'labelIds', 'sourceAgnosticCreativeId', 'sourceAgnosticLineItemId']; | |
var NR_SUBMIT_PAGE_ACTION = function(ev, obj) { | |
if (typeof window.newrelic != 'undefined' && typeof window.newrelic.addPageAction == 'function') { | |
for (i in obj) { | |
if (convertToString.indexOf(i) > -1) { | |
obj[i] = String(obj[i]); | |
} | |
} | |
window.newrelic.addPageAction(ev, obj) |