Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for PubWise Prebid 1.0 Support #1847

Merged
merged 2 commits into from
Nov 22, 2017
Merged
Changes from all commits
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
7 changes: 4 additions & 3 deletions modules/pubwiseAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const utils = require('src/utils');
const analyticsType = 'endpoint';
const analyticsName = 'PubWise Analytics: ';
let defaultUrl = 'https://api.pubwise.io/api/v4/event/default/';
let pubwiseVersion = '2.2';
let pubwiseVersion = '3.0';
let pubwiseSchema = 'AVOCET';
let configOptions = {site: '', endpoint: 'https://api.pubwise.io/api/v4/event/default/', debug: ''};
let pwAnalyticsEnabled = false;
let utmKeys = {utm_source: '', utm_medium: '', utm_campaign: '', utm_term: '', utm_content: ''};
Expand All @@ -49,8 +50,7 @@ function enrichWithUTM(dataBag) {
let newUtm = false;
try {
for (let prop in utmKeys) {
let urlValue = utils.getParameterByName(prop);
utmKeys[prop] = urlValue;
utmKeys[prop] = utils.getParameterByName(prop);
if (utmKeys[prop] != '') {
newUtm = true;
dataBag[prop] = utmKeys[prop];
Expand Down Expand Up @@ -84,6 +84,7 @@ function sendEvent(eventType, data) {
eventType: eventType,
args: data,
target_site: configOptions.site,
pubwiseSchema: pubwiseSchema,
debug: configOptions.debug ? 1 : 0,
};

Expand Down