Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

ReturnoftheCustomTask

mapClientId Task

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.

Usage

Task Code

var mapClientIdTask = (...) => {...}

You can grab the code for this task from dist/tasks/ folder

Code Example

var GA4CustomTaskInstance = new GA4CustomTask({
 allowedMeasurementIds: ["G-DEBUGEMALL"],
 tasks: [
  (requestModel) => mapClientIdTask(requestModel, 'client_id', 'event'), 
 ]
});

Parameters

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