segment-integrations / analytics-swift-optimizely

Swift
MIT License
0 stars 1 forks source link

should the `track` call modify `revenue` properties? #10

Closed skydivedan closed 6 months ago

skydivedan commented 6 months ago

Optimizely expects all revenue amounts to be represented as in Int in cents. But other plugins to Segment don't have this requirement.

Should this plugin convert revenue values before calling the Optimizely plugin? Or, perhaps have an init parameter like convertRevenueToCents which would give the caller a way to configure this?

alanjcharles commented 6 months ago

Hi @skydivedan - Sorry, I'm not sure I understand exactly. Is the revenue data not being properly recorded in Optimizely? If so, this is definitely something we can look into.

skydivedan commented 6 months ago

Hi @skydivedan - Sorry, I'm not sure I understand exactly. Is the revenue data not being properly recorded in Optimizely? If so, this is definitely something we can look into.

Optimizely expects revenue values to be in cents, represented as an integer. So, normally when I send events to Segment, the revenue value starts off (in my app) as a Decimal value. And it gets sent off to Segment that way. But in the app, when I catch the event in track, before I send it to Optimizely, I need to multiply the value by 100 and send it along to Optimizely.

There are places on Optimizely's website where it talks about wanting revenue values in cents:

Other services don't want it in cents, but Optimizely does. So, it would seem appropriate to have this plugin modify the value to be an int.

alanjcharles commented 6 months ago

got it, thanks. Will prioritize it asap