From 483e3ff3ad7e6dd9af3eec2d3d8ccf029707b925 Mon Sep 17 00:00:00 2001 From: Calliope Kostopoulou Date: Tue, 8 Oct 2024 16:08:40 -0400 Subject: [PATCH] Revert "Adtech data seeding changes (#22)" This reverts commit c2d6c7371809ac8e6a2cdf6d071bc58d5e1bf47f. --- demo/functions/apps/adtech.js | 38 ++++--------------- .../adtech/source-registration-seeder.pug | 4 +- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/demo/functions/apps/adtech.js b/demo/functions/apps/adtech.js index 94bd81f..40fb015 100644 --- a/demo/functions/apps/adtech.js +++ b/demo/functions/apps/adtech.js @@ -123,16 +123,12 @@ adtech.get('/ad-script-click-element', (req, res) => { /* -------------------------------------------------------------------------- */ /* Source registration (ad click or view) */ /* -------------------------------------------------------------------------- */ + adtech.get('/register-source-href', (req, res) => { const attributionDestination = process.env.ADVERTISER_URL // For demo purposes, sourceEventId is a random ID. In a real system, this ID would be tied to a unique serving-time identifier mapped to any information an adtech provider may need const sourceEventId = Math.floor(Math.random() * 1000000000000000) const legacyMeasurementCookie = req.cookies['__session'] - var epoch = 1 - if(req.query['epoch'] != undefined) - { - epoch = req.query['epoch'] - } const headerConfig = { source_event_id: `${sourceEventId}`, @@ -141,7 +137,7 @@ adtech.get('/register-source-href', (req, res) => { expiry: '604800', // debug_key as legacyMeasurementCookie is a simple approach for demo purposes. In a real system, you may make debug_key a unique ID, and map it to additional source-time information that you deem useful for debugging or performance comparison. debug_key: legacyMeasurementCookie, - epoch: epoch, + epoch: '4', filter_data: { campaignId: ['444'] }, @@ -172,15 +168,13 @@ adtech.get('/seed-source-registration', (req, res) => { const attributionDestination = process.env.ADVERTISER_URL // For demo purposes, sourceEventId is a random ID. In a real system, this ID would be tied to a unique serving-time identifier mapped to any information an adtech provider may need const sourceEventId = Math.floor(Math.random() * 1000000000000000) - epoch = 2 - if(req.query['epoch'] != undefined) - epoch = req.query['epoch'] + const headerConfig = { source_event_id: `${sourceEventId}`, destination: attributionDestination, // Optional: expiry of 7 days (default is 30) expiry: '604800', - epoch: epoch, + epoch: '2', filter_data: { campaignId: ['123'] }, @@ -211,17 +205,6 @@ res.sendStatus(200) adtech.get('/conversion', (req, res) => { const productCategory = req.query['product-category'] // const purchaseValue = req.query['purchase-value'] - var epcoh_end = 2 - var epoch_start = 1 - if(req.query['epoch_end'] != undefined) - { - epcoh_end = req.query['epoch_end'] - } - - if(req.query['epoch_start'] != undefined) - { - epcoh_end = req.query['epoch_start'] - } const filters = { // Because conversion_product_type has been set to category_1 in the header Attribution-Reporting-Register-Source, any incoming conversion whose productCategory does not match category_1 will be filtered out i.e. will not generate a report. @@ -249,8 +232,8 @@ adtech.get('/conversion', (req, res) => { } - const globalEpsilon = 0.1 - const attributionWindow = {epoch_start: epoch_start, epoch_end: epcoh_end} + const globalEpsilon = 0.25 + const attributionWindow = {epoch_start: 2, epoch_end: 4} const attributionLogic = "last_touch" const partitioningLogic = "" @@ -374,14 +357,7 @@ adtech.post( adtech.get( '/source-registration-seeder', async (req, res) => { - var epoch_start = 1 - var epoch_end = 1 - if(req.query['epoch_start'] != undefined) - epoch_start = req.query['epoch_start'] - if(req.query['epoch_end'] != undefined) - epoch_end = req.query['epoch_end'] - - res.render('source-registration-seeder', {adtechUrl,epoch_start,epoch_end}) + res.render('source-registration-seeder', {adtechUrl}) } ) diff --git a/demo/functions/views/adtech/source-registration-seeder.pug b/demo/functions/views/adtech/source-registration-seeder.pug index 5b5d1ca..f07a47e 100644 --- a/demo/functions/views/adtech/source-registration-seeder.pug +++ b/demo/functions/views/adtech/source-registration-seeder.pug @@ -13,8 +13,8 @@ body triggerEligible: false, }; - for (let i = #{epoch_start}; i <= #{epoch_end}; i++) { - await fetch(`#{adtechUrl}/seed-source-registration?epoch=` + i, { + for (let i = 0; i < 10; i++) { + await fetch(`#{adtechUrl}/seed-source-registration`, { keepalive: true, attributionReporting, mode: "no-cors",