Major update changing how we identify amplitude users #172
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now we are able to add cookies to the browser using resources/cookiegen.html, which has a setCookie() javascript function and a handler function that will execute commands given as get arguments. Currently we have the cookie arguments and the argument to load the user with geolocation and ip data.
Using those cookies amplitude will now take the geolocation cookie and use that information to feed amplitude. With that the geolocation (and possibly future user data features) now depends on information coming from the client side, and not the server side. This is still subject to adblockers and we are not trying to go over it. As of now we are only registering data from the user coming from http headers (although the IP needs to be registered through a third-party to go over streamlit restrictions)
Also using those cookies we store a unique user id in each user's browser. If the cookie is already present we use it as the id for amplitude and if not present we create a new one. This way we can track users way better than before when we just relied on the server-side ip.
Solved the problem of pointless amplitude logs due to cascade rerunning. Now we have an amplitude logging manager that receives the call for an event but decides if the event is worth logging or not by using our session makeshift db. This is to avoid us logging multiple times the same event when the page reloads.
Also added minor changes to Saúdem em ordem's description
Also fixed some of streamlit's timing problems that were causing bugs in our mobile version by adding some small wait and page reload triggers.