diff --git a/src/v0/destinations/bqstream/transform.js b/src/v0/destinations/bqstream/transform.js index 79826d3c09..a3e6c252bd 100644 --- a/src/v0/destinations/bqstream/transform.js +++ b/src/v0/destinations/bqstream/transform.js @@ -104,53 +104,51 @@ const processRouterDest = (inputs) => { return errorRespEvents; } const groupedEvents = getGroupedEvents(inputs); - // eslint-disable-next-line sonarjs/no-unused-collection const finalResp = []; - groupedEvents.forEach((eventList) => { + groupedEvents.forEach((eventList) => { let eventsChunk = []; // temporary variable to divide payload into chunks let errorRespList = []; if (eventList.length > 0) { eventList.forEach((event) => { - try { - if (event.message.statusCode) { - // already transformed event - eventsChunk.push(event); - } else { - // if not transformed - let response = process(event); - response = Array.isArray(response) ? response : [response]; - response.forEach((res) => { - eventsChunk.push({ - message: res, - metadata: event.metadata, - destination: event.destination, - }); + try { + if (event.message.statusCode) { + // already transformed event + eventsChunk.push(event); + } else { + // if not transformed + let response = process(event); + response = Array.isArray(response) ? response : [response]; + response.forEach((res) => { + eventsChunk.push({ + message: res, + metadata: event.metadata, + destination: event.destination, }); - } - } catch (error) { - const errRespEvent = handleRtTfSingleEventError(event, error, DESTINATION); - // divide the successful payloads till now into batches - let batchedResponseList = []; - if (eventsChunk.length > 0) { - batchedResponseList = batchEvents(eventsChunk); - } - // clear up the temporary variable - eventsChunk = []; - errorRespList.push(errRespEvent); - finalResp.push([...batchedResponseList, ...errorRespList]); - // putting it back as an empty array - errorRespList = []; + }); } + } catch (error) { + const errRespEvent = handleRtTfSingleEventError(event, error, DESTINATION); + // divide the successful payloads till now into batches + let batchedResponseList = []; + if (eventsChunk.length > 0) { + batchedResponseList = batchEvents(eventsChunk); + } + // clear up the temporary variable + eventsChunk = []; + errorRespList.push(errRespEvent); + finalResp.push([...batchedResponseList, ...errorRespList]); + // putting it back as an empty array + errorRespList = []; + } }); let batchedResponseList = []; - if (eventsChunk.length > 0) { - batchedResponseList = batchEvents(eventsChunk); - finalResp.push([...batchedResponseList]); - } + if (eventsChunk.length > 0) { + batchedResponseList = batchEvents(eventsChunk); + finalResp.push([...batchedResponseList]); + } } - }); - const allBatchedEvents =_.sortBy(finalResp.flat(), ['metadata.job_id']); - return allBatchedEvents; + }); + return finalResp.flat(); }; module.exports = { process, processRouterDest }; diff --git a/src/v0/destinations/bqstream/util.js b/src/v0/destinations/bqstream/util.js index 724315c57e..d12a874f97 100644 --- a/src/v0/destinations/bqstream/util.js +++ b/src/v0/destinations/bqstream/util.js @@ -145,51 +145,16 @@ function networkHandler() { } /** - * Splits an array of events into subarrays of track event lists. - * If any other event type is encountered, it is kept as a separate subarray. - * - * @param {Array} eachUserJourney - An array of events. eg. [track, track,identify,identify,track, track] - * @returns {Array} - An array of subarrays. eg [[track, track],[identify],[identify],[track, track]] - */ -const filterAndSplitEvents = (eachUserJourney) => { - const delimiter = 'track'; - let delimiterArray = []; - const resultArray = [] - for (const item of eachUserJourney) { - if (item.message.type === delimiter) { - delimiterArray.push(item); - } else { - if(delimiterArray.length > 0) { - resultArray.push(delimiterArray); - delimiterArray = []; - } - resultArray.push([item]); - } - } - // Push any remaining delimiterArray - if (delimiterArray.length > 0) { - resultArray.push(delimiterArray); - } - return resultArray.flat(); -}; - - -/** - * Groups the input events based on the `userId` property and filters and splits the events based on a delimiter. - * - * @param {Array} inputs - An array of objects representing events with `metadata.userId` and `message.type` properties. - * @returns {Array} An array of arrays containing the grouped and filtered events. - * Each inner array represents a user journey and contains the filtered events. + * Groups the input events based on the `userId` property + * + * @param {Array} inputs - An array of objects representing events with `metadata.userId` property. + * @returns {Array} An array of arrays containing the grouped events. + * Each inner array represents a user journey. */ const getGroupedEvents = (inputs) => { - const typeBasedOrderedEvents = []; const userIdEventMap = _.groupBy(inputs, 'metadata.userId'); const eventGroupedByUserId = Object.values(userIdEventMap); - eventGroupedByUserId.forEach((eachUserJourney) => { - const eachEventTypeArray = filterAndSplitEvents(eachUserJourney); - typeBasedOrderedEvents.push(eachEventTypeArray); - }); - return typeBasedOrderedEvents; -} + return eventGroupedByUserId; +}; module.exports = { networkHandler, getGroupedEvents }; diff --git a/src/v0/destinations/bqstream/util.test.js b/src/v0/destinations/bqstream/util.test.js deleted file mode 100644 index c5de31609f..0000000000 --- a/src/v0/destinations/bqstream/util.test.js +++ /dev/null @@ -1,62 +0,0 @@ -// Generated by CodiumAI -const { getGroupedEvents } = require('./util'); -describe('getGroupedEvents', () => { - - // // Tests that the function returns an empty array when inputs is empty - it('should return an empty array when inputs is empty', () => { - const inputs = []; - const result = getGroupedEvents(inputs); - expect(result).toEqual([]); - }); - - // // Tests that the function returns an array with one element when inputs has only one event - it('should return an array with one element when inputs has only one event', () => { - const inputs = [{ metadata: { userId: '1', job_id: '123' } }]; - const result = getGroupedEvents(inputs); - expect(result).toEqual([[{ metadata: { userId: '1', job_id: '123' } }]]); - }); - - // // Tests that the function returns an array with one element when inputs has multiple events but all have the same userId - it('should return an array with one element when inputs has multiple events with the same userId', () => { - const inputs = [ - { metadata: { userId: '1', job_id: '123' } }, - { metadata: { userId: '1', job_id: '456' } }, - { metadata: { userId: '1', job_id: '789' } } - ]; - const result = getGroupedEvents(inputs); - expect(result).toEqual([[{ metadata: { userId: '1', job_id: '123' } }, { metadata: { userId: '1', job_id: '456' } }, { metadata: { userId: '1', job_id: '789' } }]]); - }); - - // Tests that the function returns an array with multiple elements when inputs has multiple events with different userIds - it('should return an array with multiple elements when inputs has multiple events with different userIds', () => { - const inputs = [ - { metadata: { userId: '1', job_id: '123' } }, - { metadata: { userId: '2', job_id: '456' } }, - { metadata: { userId: '3', job_id: '789' } } - ]; - const result = getGroupedEvents(inputs); - console.log(JSON.stringify(result)); - expect(result).toEqual([ - [{ metadata: { userId: '1', job_id: '123' } }], - [{ metadata: { userId: '2', job_id: '456' } }], - [{ metadata: { userId: '3', job_id: '789' } }] - ]); - }); - - // Tests that the function returns an array with multiple elements when inputs has multiple events with same userIds and some have the different job_id - it('should return an array with multiple elements when inputs has multiple events with same userIds and some have the different job_id', () => { - const inputs = [ - { metadata: { userId: '1', job_id: '123' } }, - { metadata: { userId: '2', job_id: '456' } }, - { metadata: { userId: '3', job_id: '789' } }, - { metadata: { userId: '1', job_id: '981' } } - ]; - const result = getGroupedEvents(inputs); - expect(result).toEqual([ - [{ metadata: { userId: '1', job_id: '123' } }, - { metadata: { userId: '1', job_id: '981' } }], - [{ metadata: { userId: '2', job_id: '456' } }], - [{ metadata: { userId: '3', job_id: '789' } }] - ]); - }); -}); diff --git a/test/__tests__/apicontract.test.ts b/test/__tests__/apicontract.test.ts deleted file mode 100644 index dbae07b465..0000000000 --- a/test/__tests__/apicontract.test.ts +++ /dev/null @@ -1,206 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import request from 'supertest'; -import { createHttpTerminator } from 'http-terminator'; -import Koa from 'koa'; -import bodyParser from 'koa-bodyparser'; -import { applicationRoutes } from '../../src/routes'; -import min from 'lodash/min'; - -let server: any; -const OLD_ENV = process.env; - -beforeAll(async () => { - process.env = { ...OLD_ENV }; // Make a copy - const app = new Koa(); - app.use( - bodyParser({ - jsonLimit: '200mb', - }), - ); - applicationRoutes(app); - server = app.listen(9090); -}); - -afterAll(async () => { - process.env = OLD_ENV; // Restore old environment - const httpTerminator = createHttpTerminator({ - server, - }); - await httpTerminator.terminate(); -}); - -const getDataFromPath = (pathInput) => { - const testDataFile = fs.readFileSync(path.resolve(__dirname, pathInput)); - return JSON.parse(testDataFile.toString()); -}; - -const integrations = { - ACTIVE_CAMPAIGN: 'active_campaign', - ALGOLIA: 'algolia', - CANDU: 'candu', - DELIGHTED: 'delighted', - DRIP: 'drip', - FB_CUSTOM_AUDIENCE: 'fb_custom_audience', - GA: 'ga', - GAINSIGHT: 'gainsight', - GAINSIGHT_PX: 'gainsight_px', - GOOGLESHEETS: 'googlesheets', - GOOGLE_ADWORDS_ENHANCED_CONVERSIONS: 'google_adwords_enhanced_conversions', - GOOGLE_ADWORDS_REMARKETING_LISTS: 'google_adwords_remarketing_lists', - GOOGLE_ADWORDS_OFFLINE_CONVERSIONS: 'google_adwords_offline_conversions', - HS: 'hs', - ITERABLE: 'iterable', - KLAVIYO: 'klaviyo', - KUSTOMER: 'kustomer', - MAILCHIMP: 'mailchimp', - MAILMODO: 'mailmodo', - MARKETO: 'marketo', - OMETRIA: 'ometria', - PARDOT: 'pardot', - PINTEREST_TAG: 'pinterest_tag', - PROFITWELL: 'profitwell', - SALESFORCE: 'salesforce', - SFMC: 'sfmc', - SNAPCHAT_CONVERSION: 'snapchat_conversion', - TIKTOK_ADS: 'tiktok_ads', - TRENGO: 'trengo', - YAHOO_DSP: 'yahoo_dsp', - CANNY: 'canny', - LAMBDA: 'lambda', - WOOTRIC: 'wootric', - GOOGLE_CLOUD_FUNCTION: 'google_cloud_function', - BQSTREAM: 'bqstream', - CLICKUP: 'clickup', - FRESHMARKETER: 'freshmarketer', - FRESHSALES: 'freshsales', - MONDAY: 'monday', - CUSTIFY: 'custify', - USER: 'user', - REFINER: 'refiner', - FACEBOOK_OFFLINE_CONVERSIONS: 'facebook_offline_conversions', - MAILJET: 'mailjet', - SNAPCHAT_CUSTOM_AUDIENCE: 'snapchat_custom_audience', - MARKETO_STATIC_LIST: 'marketo_static_list', - CAMPAIGN_MANAGER: 'campaign_manager', - SENDGRID: 'sendgrid', - SENDINBLUE: 'sendinblue', - ZENDESK: 'zendesk', - MP: 'mp', - TIKTOK_ADS_OFFLINE_EVENTS: 'tiktok_ads_offline_events', - CRITEO_AUDIENCE: 'criteo_audience', - CUSTOMERIO: 'customerio', - BRAZE: 'braze', - OPTIMIZELY_FULLSTACK: 'optimizely_fullstack', - TWITTER_ADS: 'twitter_ads', -}; - -const features = getDataFromPath('../../src/features.json'); -let allIntegrations: string[] = []; -Object.keys(features.routerTransform).forEach((feature) => { - allIntegrations.push(integrations[feature]); -}); - -console.log(allIntegrations); - -const assertRouterOutput = (routerOutput, inputData) => { - const returnedJobids = {}; - routerOutput.forEach((outEvent) => { - //Assert that metadata is present and is an array - const metadata = outEvent.metadata; - expect(Array.isArray(metadata)).toEqual(true); - - //Assert that statusCode is present and is a number between 200 and 600 - const statusCode = outEvent.statusCode; - expect(statusCode).toBeDefined(); - expect(typeof statusCode === 'number').toEqual(true); - const validStatusCode = statusCode >= 200 && statusCode < 600; - expect(validStatusCode).toEqual(true); - - //Assert that every job_id in the input is present in the output one and only one time. - metadata.forEach((meta) => { - const jobId = meta.jobId; - expect(returnedJobids[jobId]).toBeUndefined(); - returnedJobids[jobId] = true; - }); - }); - - const inputJobids = {}; - inputData.input.forEach((input) => { - const jobId = input.metadata.jobId; - inputJobids[jobId] = true; - }); - - expect(returnedJobids).toEqual(inputJobids); - - if (inputData.order) { - routerOutput.sort((a, b) => { - const aMin = min(a.metadata.map((meta) => meta.jobId)); - const bMin = min(b.metadata.map((meta) => meta.jobId)); - return aMin - bMin; - }); - - let userIdJobIdMap = {}; - routerOutput.forEach((outEvent) => { - const metadata = outEvent.metadata; - metadata.forEach((meta) => { - const jobId = meta.jobId; - const userId = meta.userId; - let arr = userIdJobIdMap[userId] || []; - arr.push(jobId); - userIdJobIdMap[userId] = arr; - }); - }); - - //The jobids for a user should be in order. If not, there is an issue. - Object.keys(userIdJobIdMap).forEach((userId) => { - const jobIds = userIdJobIdMap[userId]; - for (let i = 0; i < jobIds.length - 1; i++) { - expect(jobIds[i] < jobIds[i + 1]).toEqual(true); - } - }); - } -}; - -describe('Router transform tests', () => { - allIntegrations.forEach((integration) => { - const data = getDataFromPath('./data/generic_router_input.json'); - data.input.forEach((inputData) => { - test(`${integration} router transform`, async () => { - inputData.destType = integration; - - const response = await request(server) - .post('/routerTransform') - .set('Accept', 'application/json') - .send(inputData); - expect(response.status).toEqual(200); - - const routerOutput = JSON.parse(response.text).output; - - assertRouterOutput(routerOutput, inputData); - }); - }); - }); -}); - -const batchIntegrations = ['am', 'kafka']; -describe('Batch tests', () => { - batchIntegrations.forEach((integration) => { - const data = getDataFromPath('./data/generic_router_input.json'); - data.input.forEach((inputData) => { - test(`${integration} batch`, async () => { - inputData.destType = integration; - - const response = await request(server) - .post('/batch') - .set('Accept', 'application/json') - .send(inputData); - expect(response.status).toEqual(200); - - const routerOutput = JSON.parse(response.text); - - assertRouterOutput(routerOutput, inputData); - }); - }); - }); -}); diff --git a/test/__tests__/data/generic_router_input.json b/test/__tests__/data/generic_router_input.json deleted file mode 100644 index 5f1cfcd1c0..0000000000 --- a/test/__tests__/data/generic_router_input.json +++ /dev/null @@ -1,797 +0,0 @@ -{ - "input": [ - { - "input": [ - { - "message": { - "channel": "web", - "type": "identify", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "xyz", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "apiKey": "abcde", - "groupTypeTrait": "email", - "groupValueTrait": "age" - } - } - }, - { - "message": { - "channel": "web", - "type": "page", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "xyz", - "userId": "12345", - "properties": { - "referrer": "", - "url": "https://www.rudderstack.com", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "abcde" - } - } - } - ], - "destType": "xyz", - "order": false - }, - { - "input": [ - { - "message": {}, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": {} - } - }, - { - "message": {}, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": {} - } - } - ], - "destType": "xyz", - "order": false - }, - { - "input": [ - { - "message": { - "type": "identify", - "sentAt": "2023-07-25T18:17:52.117Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-AS", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "traits": { - "locale": "es" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:52.885Z", - "receivedAt": "2023-07-25T18:17:52.887Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.115Z" - }, - "metadata": { - "userId": "u1", - "jobId": 3 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "track", - "event": "j", - "sentAt": "2023-07-25T18:17:52.117Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-AS", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:52.885Z", - "properties": { - "gtm container version": "1354" - }, - "receivedAt": "2023-07-25T18:17:52.887Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.115Z" - }, - "metadata": { - "userId": "u2", - "jobId": 4 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "identify", - "sentAt": "2023-07-25T18:17:52.137Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-WE", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "traits": { - "user role": "BASIC" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36", - "trackingPlanVersion": 80 - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:52.893Z", - "receivedAt": "2023-07-25T18:17:52.895Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.135Z" - }, - "metadata": { - "userId": "u2", - "jobId": 5 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "identify", - "sentAt": "2023-07-25T18:17:52.139Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-PEC", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "traits": { - "locale": "es" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:52.900Z", - "receivedAt": "2023-07-25T18:17:52.902Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.137Z" - }, - "metadata": { - "userId": "u1", - "jobId": 6 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "track", - "event": "j", - "sentAt": "2023-07-25T18:17:52.139Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-EW", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:52.900Z", - "properties": { - "gtm container version": "1354" - }, - "receivedAt": "2023-07-25T18:17:52.902Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.137Z" - }, - "metadata": { - "userId": "u1", - "jobId": 7 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "identify", - "sentAt": "2023-07-25T18:17:52.143Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-TR", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "traits": { - "user role": "BASIC" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36", - "trackingPlanVersion": 80 - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:52.910Z", - "receivedAt": "2023-07-25T18:17:52.911Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.142Z" - }, - "metadata": { - "userId": "u1", - "jobId": 8 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "identify", - "sentAt": "2023-07-25T18:17:52.145Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-QW", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "traits": { - "locale": "es" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:52.955Z", - "receivedAt": "2023-07-25T18:17:52.956Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.144Z" - }, - "metadata": { - "userId": "u1", - "jobId": 9 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "track", - "event": "j", - "sentAt": "2023-07-25T18:17:52.145Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-HF", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:52.955Z", - "properties": { - "gtm container version": "1354" - }, - "receivedAt": "2023-07-25T18:17:52.956Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.144Z" - }, - "metadata": { - "userId": "u2", - "jobId": 10 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "identify", - "sentAt": "2023-07-25T18:17:52.260Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-HG", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "traits": { - "locale": "es" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:53.046Z", - "receivedAt": "2023-07-25T18:17:53.048Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.258Z" - }, - "metadata": { - "userId": "u2", - "jobId": 21 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "track", - "event": "j", - "sentAt": "2023-07-25T18:17:52.260Z", - "userId": "user1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "es-LK", - "screen": { - "width": 1536, - "height": 864, - "density": 1.25, - "innerWidth": 1536, - "innerHeight": 739 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:53.046Z", - "properties": { - "gtm container version": "1354" - }, - "receivedAt": "2023-07-25T18:17:53.048Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.258Z" - }, - "metadata": { - "userId": "u1", - "jobId": 22 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "track", - "event": "j", - "sentAt": "2023-07-25T18:17:52.968Z", - "userId": "86217534", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "$direct", - "initial_referrer": "$direct", - "referring_domain": "", - "initial_referring_domain": "" - }, - "locale": "en-QW", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 1064, - "innerHeight": 622 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:53.112Z", - "properties": { - "gtm container version": "1354" - }, - "receivedAt": "2023-07-25T18:17:53.120Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:17:52.960Z" - }, - "metadata": { - "userId": "u1", - "jobId": 23 - }, - "destination": { - "Config": {} - } - }, - { - "message": { - "type": "track", - "event": "contentSubmission", - "sentAt": "2023-07-25T18:19:17.155Z", - "userId": "adg", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "https://www.rudderstack.com", - "referrer": "https://www.rudderstack.com/", - "initial_referrer": "https://www.google.com/", - "referring_domain": "www.rudderstack.com", - "initial_referring_domain": "www.google.com" - }, - "locale": "en-CA", - "screen": { - "width": 1440, - "height": 900, - "density": 1, - "innerWidth": 1440, - "innerHeight": 862 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "2.38.1" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15" - }, - "rudderId": "xyz", - "timestamp": "2023-07-25T18:17:42.148Z", - "properties": { - "gtm container version": "1354" - }, - "receivedAt": "2023-07-25T18:17:53.410Z", - "anonymousId": "xyz", - "integrations": { - "All": true - }, - "originalTimestamp": "2023-07-25T18:19:05.893Z" - }, - "metadata": { - "userId": "u1", - "jobId": 24 - }, - "destination": { - "Config": {} - } - } - ], - "destType": "xyz", - "order": true - } - ] -}