Skip to content

How to send Parameters correct: session_id, engagement_time_msec #31

@joerg-thode

Description

@joerg-thode

Hello everybody!
I want to send a purchase event with the session_id of the user. How can i di these?

@ Google:

https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=gtag&hl=en#required_parameters

{
"client_id": "x",
"events": [
{
"name": "offline_purchase",
"params": {
"engagement_time_msec": "100",
"session_id": "123"
}
}
]
}

@ BR33f V1.2,

this is my code-part, i get no error :-) but it seems not to work

$eventData = new PurchaseEvent();
$eventParamList = [
"engagement_time_msec" => "5000",
"session_id" => $measurementSessionId
];
foreach($eventParamList as $ePKey => $ePValue){
$eventData->setParamValue($ePKey, $ePValue);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions