diff --git a/integrationExamples/gpt/growthcode.html b/integrationExamples/gpt/growthcode.html index d8ad6c4a5af..35de2b710ad 100644 --- a/integrationExamples/gpt/growthcode.html +++ b/integrationExamples/gpt/growthcode.html @@ -56,20 +56,11 @@ provider: 'growthCodeAnalytics', options: { pid: 'TEST01', + //url: 'http://localhost:8080/v3/pb/analytics', trackEvents: [ - 'auctionInit', 'auctionEnd', - 'bidAdjustment', - 'bidTimeout', - 'bidTimeout', - 'bidRequested', - 'bidResponse', - 'setTargeting', - 'requestBids', - 'addAdUnits', - 'noBid', 'bidWon', - 'bidderDone'] + ] } }); pbjs.setConfig({ @@ -80,7 +71,7 @@ auctionDelay: 1000, dataProviders: [{ name: 'growthCodeRtd', - waitForIt: true, + waitForIt: false, params: { pid: 'TEST01', } diff --git a/modules/growthCodeAnalyticsAdapter.js b/modules/growthCodeAnalyticsAdapter.js index 655f8af53a3..e7c572ae48a 100644 --- a/modules/growthCodeAnalyticsAdapter.js +++ b/modules/growthCodeAnalyticsAdapter.js @@ -13,7 +13,7 @@ import {MODULE_TYPE_ANALYTICS} from '../src/activities/modules.js'; const MODULE_NAME = 'growthCodeAnalytics'; const DEFAULT_PID = 'INVALID_PID' -const ENDPOINT_URL = 'https://p2.gcprivacy.com/v1/pb/analytics' +const ENDPOINT_URL = 'https://p2.gcprivacy.com/v3/pb/analytics' export const storage = getStorageManager({moduleType: MODULE_TYPE_ANALYTICS, moduleName: MODULE_NAME}); @@ -138,12 +138,15 @@ growthCodeAnalyticsAdapter.enableAnalytics = function(conf = {}) { function logToServer() { if (pid === DEFAULT_PID) return; - if (eventQueue.length > 1) { + if (eventQueue.length >= 1) { + // Get the correct GCID + let gcid = localStorage.getItem('gcid') + let data = { session: sessionId, pid: pid, + gcid: gcid, timestamp: Date.now(), - timezoneoffset: new Date().getTimezoneOffset(), url: getRefererInfo().page, referer: document.referrer, events: eventQueue @@ -167,7 +170,7 @@ function sendEvent(event) { eventQueue.push(event); logInfo(MODULE_NAME + 'Analytics Event: ' + event); - if (event.eventType === CONSTANTS.EVENTS.AUCTION_END) { + if ((event.eventType === CONSTANTS.EVENTS.AUCTION_END) || (event.eventType === CONSTANTS.EVENTS.BID_WON)) { logToServer(); } } diff --git a/modules/growthCodeAnalyticsAdapter.md b/modules/growthCodeAnalyticsAdapter.md index e45cb2e9c62..6625d492ee6 100644 --- a/modules/growthCodeAnalyticsAdapter.md +++ b/modules/growthCodeAnalyticsAdapter.md @@ -21,13 +21,7 @@ pbjs.enableAnalytics({ pid: '', trackEvents: [ 'auctionEnd', - 'bidAdjustment', - 'bidTimeout', - 'bidRequested', - 'bidResponse', - 'noBid', - 'bidWon', - 'bidderDone'] + 'bidWon'] } }); ``` diff --git a/test/spec/modules/growthCodeAnalyticsAdapter_spec.js b/test/spec/modules/growthCodeAnalyticsAdapter_spec.js index e542a2641e8..cd9c12a729c 100644 --- a/test/spec/modules/growthCodeAnalyticsAdapter_spec.js +++ b/test/spec/modules/growthCodeAnalyticsAdapter_spec.js @@ -64,7 +64,6 @@ describe('growthCode analytics adapter', () => { var eventTypes = []; body.events.forEach(e => eventTypes.push(e.eventType)); assert(eventTypes.length > 0) - assert(eventTypes.indexOf(constants.EVENTS.AUCTION_END) > -1); growthCodeAnalyticsAdapter.disableAnalytics(); }); });