ahoy icon indicating copy to clipboard operation
ahoy copied to clipboard

[Idea] Modification to Ahoy::DatabaseStore.track_visit

Open jmartyniak opened this issue 2 years ago • 1 comments

Hello,

I have an idea for a modification.

Basically would like to change Ahoy::DatabaseStore.track_visit to not only create a visit but update a visit.

The use case is simple we are adding a fingerprint to a visit. However, the fingerprint is generated asynchronously, and on some browsers, the visit has been created before the fingerprint is generated. So it needs to be updated. I have changed the Ahoy.js CreateVisit to handle the additional request in the use case when a visit exists.

So it would be helpful to send new/updated data to the server and the visit.

I have made corresponding changes to Ahoy.js to send visit data back.

Is this a good idea? Are there apparent flaws?

If it is something of interest, I can make a pull request...I think.

jmartyniak avatar Jun 21 '23 21:06 jmartyniak

@jmartyniak hello, what is the result?

FaxriddinMaxmadiyorov avatar Sep 28 '23 09:09 FaxriddinMaxmadiyorov