ahoy.js
ahoy.js copied to clipboard
[Idea] The ability to update a visit, or be able to start a visit programmatically.
Here is the use case: The app is a ruby rails app, that serves HTML so no real sense of a Javascript application.
I am generating a fingerprint using fingerprintjs, which returns the result with a callback. This callback sometimes returns quickly or slowly, which seems to be based on the browser. For example in chrome it returns quickly, and on Firefox it returns slowly.
And in some cases, the visit has already been created. So when I call ahoy.configure in the callback the visit is already created and the fingerprint is never set.
A couple of thoughts:
- whenever configure is called it updates the visit.
createVisitis exposed or a new helper method is createdupsertVisit.
Other ideas? Am I thinking about this incorrectly?