Skip to main content

Attribution Value to Events

Fetch Conversions

You can retrieve all conversions that occurred between a time frame by calling the conversionsSource method:

$ grpc_cli call attribution.cdp.example.com:8888 eu.shiftforward.adstax.api.attribution.grpc.service.Attribution/conversionsSource 'startTime: 1539693160981, endTime: 1539693174897'

(This example uses gprc_cli to make the gRPC request, but any other gRPC client will work)

The response will be a stream of conversions. A conversion consists of a conversion event and their respective attributable events.

For more details on what a conversion event represents, see the Attribution Report page.

Attribute Value

After you've applied your attribution model to the previously retrieved conversions, you should now have a value for each attributable event. This value signifies the importance, in a percentual format, that said attributable event had in leading to the conversion event.

To import the value of a conversion to Kevel Audience you can use the method addAttributionValues, which takes as input the model used to calculate the values, the ID of the conversion event, and a Map of attributableId (ID of the attributable event) to value (from 0 to 1, percentual). Attributable events not present in the Map will be automatically given a value of 0. If the total sum of values is different from 1 (±0.01) the method will fail.

$ grpc_cli call attribution.cdp.example.com:8888 eu.shiftforward.adstax.attribution.api.grpc.service.Attribution/addAttributionValues \ '
model: "position-based",
conversionId: "932bc00c-66c5-4016-838d-7eacff027f79",
valuesByAttributableId {
key: "0970c9c2-cf6f-43c8-a188-591e48da8d0c"
value: 0.75
}
valuesByAttributableId {
key: "b2aaf9e1-917b-40a1-93ec-98136ad56385"
value: 0
}
valuesByAttributableId {
key: "02eb0b3c-076d-4424-a87f-94b4a8f75116"
value: 0
}
valuesByAttributableId {
key: "cd5ecfa1-92fe-4492-a95b-f9d0b5405127"
value: 0.25
}
'