Skip to content

Commit

Permalink
Merge pull request #36 from managed-components/add-additional-payload…
Browse files Browse the repository at this point in the history
…-overrides

Add additional payload overrides
  • Loading branch information
ad-astra-via authored Jul 11, 2024
2 parents ce102e7 + ba1ed00 commit 759d2e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/requestBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function getToolRequest(
tid: settings.tid,
sr: client.screenWidth + 'x' + client.screenHeight,
ul: client.language,
dt: client.title,
...getParamSafely('dt', [payload.dt, client.title]),
_s: eventsCounter,
...(!(payload.hideOriginalIP || settings.hideOriginalIP) && {
_uip: client.ip,
Expand Down Expand Up @@ -103,7 +103,7 @@ function getToolRequest(
requestBody['_fv'] = 1 // No Client ID -> setting "First Visit"
}
client.set('ga4', cid, { scope: 'infinite' })
requestBody['cid'] = cid
requestBody['cid'] = payload.cid || cid

//const notTheFirstSession = parseInt(requestBody['_s'] as string) > 1
const engagementDuration =
Expand Down Expand Up @@ -164,6 +164,8 @@ function getToolRequest(
'dbg',
'gcs',
'gcd',
'cid',
'dt',
]
const eventData = flattenKeys(payload)

Expand Down

0 comments on commit 759d2e8

Please sign in to comment.