This task will read the current clientId ( &cid ) value from the request and map it back as an event parameter to all events in the payload.
In the other side if we set the scope as 'user' it will ba attached just to the first event on the request as an user property.
var mapClientIdTask = (...) => {...}
You can grab the code for this task from dist/tasks/ folder
var GA4CustomTaskInstance = new GA4CustomTask({
allowedMeasurementIds: ["G-DEBUGEMALL"],
tasks: [
(requestModel) => mapClientIdTask(requestModel, 'client_id', 'event'),
]
});
mapClientIdTask(requestModel, '{{NAME}}', '{{SCOPE}}')
| Parameter | Type | Description |
|---|---|---|
| name | string | It's the event-property or user parameter key that will be used |
| scope | string | Event or User. 'event' will be used by default |
