New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
?meta query param #24
Comments
What is happening in case of further tracking for a special key? For example:
In the moment I've no real use case in mind - Sorry |
I think you'd just add a new record. What's the use case for updating it? First visit: Results in: [{
time: 100,
meta: {
user: 'asdf123',
sessionlength: '1m2s',
},
}, {
time: 120,
meta: {
user: 'asdf123',
sessionlength: '0m50s',
},
}] Then when you want to display your analytics, you can iterate through the records and display a graph of how long your users spend on their first and subsequent visits, and how much time non-registered users spend, for example. There's tons of ways you could use this! |
FWIW, I do think this is pretty important since we largely throw out query params sent by the user. Another option could be that you put any query params that are not colliding with ours into the meta data: so
The benefit here is that it's a pretty obvious pattern once you know it's available and you wouldn't have to worry about potent comma escaping problems. The drawback is that people could use params that we would want to reserve. I think I am leaning towards |
I think this would be really useful 👌 I would vote for the meta key variant since putting everything in the query into meta will make every feature that needs a query option will be a breaking change since somebody might already be relying on that key. Also I don't like the idea of forcing users to change naming of things because we occupy the naming space of the query parameters. |
Does that mean you're for using |
Yes, i am for using In the case of |
Good call! |
Sounds good 👍 |
We could add support for
?meta
on GET requests that increment, which would allow users to save arbitrary information in the database. We allow them to send key-value pairs in thekey:value
format, and putting many of these pairs together delimited with a commakey:value,key2:value2
to not clash with other query params.For example, this request:
Would store this in the database:
By allow this we make users able to build more sophisticated analytics tracking where they can save things like the length of the session, how many pages were visited etc.
Do you reckon this is useful?
The text was updated successfully, but these errors were encountered: