-
Notifications
You must be signed in to change notification settings - Fork 0
setup unique user analytics #20
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
Conversation
| }, [allPlugins, user, setAvailableTools]); | ||
|
|
||
| /*NJ: GTM snippet is manually inserted in <head> and <body>, and the use of a custom logEvent() function for analytics | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for not using the built-in tag manager init code? If we used it, could we skip all the changes in index.html?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would address my concern as well
| (data: { text: string }) => { | ||
| submitMessage(data); | ||
| const uniqueUserFlagKey: string = 'unique_user_prompt'; | ||
| if (!window.localStorage.getItem(uniqueUserFlagKey)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The analytics question we're trying to answer is "Number of unique users (a single prompt)", right?
In that case, I wouldn't rely on local logic to solve that - instead, we just need to log each time someone makes a prompt (e.g. a "sent prompt" event). Then, when we analyze the data, we can analyze the "sent prompt" event, separating by unique users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It definitely seems like edits to this file will put us at odds with the upstream. Is there a way we could provide a different index.html in the nj directory and repoint our stuff at that? Maybe not feasible, maybe this is a necessary divergence point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or Dan's comment about using built-in tag management
|
Per PM guidance, analytics requests were for the current version (now complete). Work on v2.0 can start, but this approach may not be necessary, so closing this PR/ticket. |
Description
This PR implements integrating the GTM container code into the project and sets up the logging function for tracking the unique user metric.
Ticket
This work resolves Google Analytics Setup: Number of unique users (a single prompt).
Approach
unique_user_prompt)Steps to Test
unique_user_promptlog.Notes