Skip to content

Commit

Permalink
Agma Analytics Adapter: adds deviceHeight and deviceWidth to request (#…
Browse files Browse the repository at this point in the history
…11305)

* Adds deviceHeight and deviceWidth to request

* Increase internal version number
  • Loading branch information
steffenmllr authored Apr 8, 2024
1 parent b37baca commit 7f93cb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/agmaAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { config } from '../src/config.js';
const GVLID = 1122;
const ModuleCode = 'agma';
const analyticsType = 'endpoint';
const scriptVersion = '1.7.1';
const scriptVersion = '1.8.0';
const batchDelayInMs = 1000;
const agmaURL = 'https://pbc.agma-analytics.de/v1';
const pageViewId = generateUUID();
Expand Down Expand Up @@ -127,6 +127,7 @@ export const getPayload = (auctionIds, options) => {
};

if (useExtendedPayload) {
const device = config.getConfig('device') || {};
const { x, y } = getScreen();
const userIdsAsEids = getUserIDs();
payload = {
Expand All @@ -141,6 +142,8 @@ export const getPayload = (auctionIds, options) => {
pageUrl: ri.page,
screenWidth: x,
screenHeight: y,
deviceWidth: device.w || screen.width,
deviceHeight: device.h || screen.height,
userIdsAsEids,
};
}
Expand Down
4 changes: 4 additions & 0 deletions test/spec/modules/agmaAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const extendedKey = [
'referrer',
'screenHeight',
'screenWidth',
'deviceWidth',
'deviceHeight',
'scriptVersion',
'timestamp',
'timezoneOffset',
Expand Down Expand Up @@ -333,6 +335,8 @@ describe('AGMA Analytics Adapter', () => {
expect(request.url).to.equal(INGEST_URL);
expect(requestBody).to.have.all.keys(extendedKey);
expect(requestBody.triggerEvent).to.equal(constants.EVENTS.AUCTION_INIT);
expect(requestBody.deviceWidth).to.equal(screen.width);
expect(requestBody.deviceHeight).to.equal(screen.height);
expect(server.requests).to.have.length(1);
expect(agmaAnalyticsAdapter.auctionIds).to.have.length(0);
});
Expand Down

0 comments on commit 7f93cb2

Please sign in to comment.