Skip to content

Conversation

@ShiCheng-Lu
Copy link

@ShiCheng-Lu ShiCheng-Lu commented Nov 18, 2024

Save user._id from track result to be used in conversion event. Which is the current behavior of mobile sdks.

It doesn't look like the userId takes priority over the deviceId/installId, so if there is a mismatch, it still logs to the user associated with deviceId/installId.
So I concluded that this endpoint is not meant to be able to log a conversion for a different user than the current logged in user.
Which means that if we do have an _id, there is no reason not to use it.
(originally, I had it where it only uses _id if none of the other parameters are provided, or is the same as the saved value, but this is not necessary if the conversion call should only post event for the current user).

Tested with the demo app:

  • track once (saves the _id to storage)
  • log conversion without any field in the userId input
  • this should result in id being populated in the POST event API call, and event is logged in dashboard.
Screenshot 2024-11-18 at 3 03 14 PM Screenshot 2024-11-18 at 3 03 20 PM Screenshot 2024-11-18 at 5 03 35 PM

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also send _id up in track if it exists (makes subsequent tracks more performant).

@ShiCheng-Lu ShiCheng-Lu marked this pull request as ready for review November 18, 2024 22:04

const data = {
const data: any = {
id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to verify, id is the correct param (not _id)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants