Skip to content
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

[🕹️] Filter document analytics by link and views #1228

Open
mfts opened this issue Oct 22, 2024 · 11 comments · May be fixed by #1256
Open

[🕹️] Filter document analytics by link and views #1228

mfts opened this issue Oct 22, 2024 · 11 comments · May be fixed by #1256

Comments

@mfts
Copy link
Owner

mfts commented Oct 22, 2024

What side quest or challenge are you solving?

In each document, we have aggregated document analytics and in order to better understand the analytics, we want to filter it.

  • filter by link
  • filter by view
  • exclude link(s)
  • exclude view(s)
  • filter by viewer (i.e. email)

CleanShot 2024-10-22 at 20 27 46@2x

Considerations

Please use url query params or the url query framework nuqs for controlling the state in the url for each filter. This way we always know what we are filtering on.

We already have some functions and pipes in Tinybird that retrieve the relevant data for a set of viewIds

export const getDocumentDurationPerViewer = tb.buildPipe({
pipe: "get_document_duration_per_viewer__v1",
parameters: z.object({
documentId: z.string(),
viewIds: z.string().describe("Comma separated viewIds"),
}),
data: z.object({
sum_duration: z.number(),
}),
});

and the corresponding Tinybird pipe:
https://github.com/mfts/papermark/blob/832b432e234b52f1c42d29f5afa92ff9db48256b/lib/tinybird/endpoints/get_document_duration_per_viewer.pipe

Inspiration:

I'm thinking about google flight search where the airlines filter has a toggle for all, only one, or checkbox to (de)select multiple airlines

CleanShot 2024-10-22 at 20 32 33@2x


Please only serious PRs. This will likely take some experimenting, you need to create a tinybird account in order to fully test the implementation yourself.

Points

1500 Points

Provide proof that you've completed the task

Open a PR with working code to the solution, detailed explanation what you did and ideally a video of the working solution.

@RajuGangitla
Copy link
Contributor

/assign

Copy link

oss-gg bot commented Oct 22, 2024

Assigned to @RajuGangitla! Please open a draft PR linking this issue within 48h ⚠️ If we can't detect a PR from you linking this issue in 48h, you'll be unassigned automatically 🕹️ Excited to have you ship this 🚀

Copy link

oss-gg bot commented Oct 23, 2024

@RajuGangitla, please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12 hours, you will be unassigned automatically.

@RajuGangitla
Copy link
Contributor

RajuGangitla commented Oct 24, 2024

@mfts im trying to setup the tiny bbird database and it added bunch of files am i doing anything wrong

image

image

@mfts
Copy link
Owner Author

mfts commented Oct 24, 2024

@RajuGangitla Yes that's adding all the python files. You don't need to commit them.

Did you open open a python shell with pipenv?

@mfts
Copy link
Owner Author

mfts commented Oct 24, 2024

@RajuGangitla If you have pipenv install on your computer, then inside the repo directory, you can call pipenv shell to open a python shell with the tinybird package installed.

@RajuGangitla
Copy link
Contributor

RajuGangitla commented Oct 24, 2024

@mfts Its still throwing Error: invalid authentication token. Workspace not found, make sure you use the token host https://api.us-east.tinybird.co
am i doing anything wrong

screen-capture.23.mp4

@mfts
Copy link
Owner Author

mfts commented Oct 24, 2024

In tinybird when you create the account and token, you need to add the pipe to the token permissions. You do that inside the tinybird dashboard

@RajuGangitla
Copy link
Contributor

maybe that time i didnt add that
is there any way to add pipes to existing tokesns
if not i need to create a new token ?
image

is this the pipes i need to add
image

@mfts
Copy link
Owner Author

mfts commented Oct 24, 2024

Yes. But to solve this issue you probably need to create a new pipe as well that fits this criteria

@ummm288
Copy link

ummm288 commented Oct 24, 2024

to fix your trouble check this solution click
maybe this will solve your problem.

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

Successfully merging a pull request may close this issue.

3 participants