Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions integrations/adroll/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ var AdRoll = (module.exports = integration('AdRoll')
.option('advId', '')
.option('pixId', '')
.option('_version', 2)
.tag('http', '<script src="http://a.adroll.com/j/roundtrip.js">')
.tag('https', '<script src="https://s.adroll.com/j/roundtrip.js">')
.tag('<script src="{{protocol}}://{{host}}/j/{{advId}}/roundtrip.js">')
.mapping('events'));

/**
* Initialize.
*
* http://support.adroll.com/getting-started-in-4-easy-steps/#step-one
* http://support.adroll.com/enhanced-conversion-tracking/
* https://help.adroll.com/hc/en-us/articles/212629938-Enhanced-Conversion-Tracking
*
* @api public
*/
Expand All @@ -43,8 +41,13 @@ AdRoll.prototype.initialize = function() {
window.adroll_adv_id = this.options.advId;
window.adroll_pix_id = this.options.pixId;
window.__adroll_loaded = true;
var name = useHttps() ? 'https' : 'http';
this.load(name, this.ready);
var protocol = useHttps() ? 'https' : 'http';
var host = protocol === 'https' ? 's.adroll.com' : 'a.adroll.com';
this.load({
protocol: protocol,
host: host,
advId: this.options.advId
}, this.ready);

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated script URL logic (protocol/host/advId locals passed to load) isn’t covered by tests. Since this integration already has a test suite, please add an assertion that initialize() calls load with locals that produce .../j/{advId}/roundtrip.js (and ideally verify both the http and https host selection). This will prevent regressions back to the generic roundtrip.js URL.

Copilot uses AI. Check for mistakes.
};

/**
Expand Down