Skip to content

Commit

Permalink
ZetaGlobalSspAnalytics Adapter: domain and page
Browse files Browse the repository at this point in the history
  • Loading branch information
asurovenko-zeta committed Jan 20, 2025
1 parent 9ceed1f commit fefb6bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions modules/zeta_global_sspAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import adapterManager from '../src/adapterManager.js';
import {EVENTS} from '../src/constants.js';

import adapter from '../libraries/analyticsAdapter/AnalyticsAdapter.js';
import {config} from '../src/config.js';
import {parseDomain} from '../src/refererDetection.js';

const ZETA_GVL_ID = 833;
const ADAPTER_CODE = 'zeta_global_ssp';
Expand All @@ -27,10 +29,11 @@ function sendEvent(eventType, event) {
/// /////////// ADAPTER EVENT HANDLER FUNCTIONS //////////////

function adRenderSucceededHandler(args) {
const page = config.getConfig('pageUrl') || args.doc?.location?.host + args.doc?.location?.pathname;
const event = {
zetaParams: zetaParams,
domain: args.doc?.location?.host,
page: args.doc?.location?.host + args.doc?.location?.pathname,
domain: parseDomain(page, {noLeadingWww: true}),
page: page,
bid: {
adId: args.bid?.adId,
requestId: args.bid?.requestId,
Expand Down
5 changes: 3 additions & 2 deletions test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ describe('Zeta Global SSP Analytics Adapter', function () {
sandbox = sinon.sandbox.create();
requests = server.requests;
sandbox.stub(events, 'getEvents').returns([]);
config.setConfig({ pageUrl: 'https://www.config.domain.com/index.html' })
});

afterEach(function () {
Expand Down Expand Up @@ -624,8 +625,8 @@ describe('Zeta Global SSP Analytics Adapter', function () {
shortname: 'name'
}
});
expect(auctionSucceeded.domain).to.eql('test-zeta-ssp.net');
expect(auctionSucceeded.page).to.eql('test-zeta-ssp.net/zeta-ssp/ssp/_dev/examples/page_banner.html');
expect(auctionSucceeded.domain).to.eql('config.domain.com');
expect(auctionSucceeded.page).to.eql('https://www.config.domain.com/index.html');
expect(auctionSucceeded.bid).to.be.deep.equal({
adUnitCode: '/19968336/header-bid-tag-0',
adId: '5759bb3ef7be1e8',
Expand Down

0 comments on commit fefb6bb

Please sign in to comment.