-
Notifications
You must be signed in to change notification settings - Fork 1
PRSD-1610/spike plausible custom events #823
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
Open
Bill-Haigh
wants to merge
5
commits into
main
Choose a base branch
from
PRSD-1610/spike-plausible-custom-events
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1aad881
PRSD-1610 started ADR
Bill-Haigh 784740c
PRSD-1610: ADR
Bill-Haigh eb8b366
PRSD-1610: updated as per comments
Bill-Haigh 890fcf8
Merge branch 'main' into PRSD-1610/spike-plausible-custom-events
Bill-Haigh 97dd4f2
PRSD-1610: changes made as per review
Bill-Haigh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # ADR-0034: Plausible custom events | ||
|
|
||
| ## Status | ||
|
|
||
| Accepted | ||
|
|
||
| Date of decision: {yyyy-MM-dd} | ||
|
|
||
| ## Context and Problem Statement | ||
|
|
||
| We want to be able to generate a Sankey diagram for each of our journeys showing the paths that users take through the journey and where they are dropping out. By default, Plausible’s API & default events do not give us enough data at suitable granularity to generate these diagrams. | ||
|
|
||
| ## Considered Options | ||
|
|
||
| * Event generation: | ||
| * Front-end custom events. | ||
| * Back-end custom events. | ||
| * Event data: | ||
| * Using the referrer header. | ||
| * Using Session ID. | ||
|
|
||
| ## Decision Outcome | ||
|
|
||
| Front-end events using the referrer header, because this provides sufficient data (as demonstrated by a spike) and is the simplest technical change. | ||
|
|
||
| ## Pros and Cons of the Options | ||
|
|
||
| ### Event generation | ||
|
|
||
| #### Front-end custom events | ||
|
|
||
| Send events to Plausible (via JavaScript) on page load in the browser. Provide data to the browser via model attributes populated by a custom interceptor. | ||
|
|
||
| * Good, because the implementation is straightforward and has minimal impact on the rest of the webapp. | ||
| * Good, because the data is sent on page load, so there is no risk of missing data due to server-side issues. | ||
| * Bad, because it relies on the browser to send the data, which could be blocked by ad blockers or other privacy tools. However, this could be mitigated by proxying Plausible. | ||
| * Bad, because it relies on JavaScript being enabled in the browser. | ||
|
|
||
| #### Back-end custom events | ||
|
|
||
| Send events to Plausible from the server-side application, by integrating with the journey framework's handling of GET requests. | ||
|
|
||
| * Good, because it does not rely on the browser to send the data, so it is less likely to be blocked by ad blockers or other privacy tools. | ||
| * Good, because it does not rely on JavaScript being enabled in the browser. | ||
| * Bad, because it requires additional implementation work to integrate with the journey framework. | ||
|
|
||
| ### Event data | ||
|
|
||
| #### Using the referrer header | ||
|
|
||
| Send a custom event to Plausible on each page load with the following: | ||
| 1. `"Flow": {props: {"page-a", "page-b"}}` | ||
| 2. Where `page-a` is the referrer and `page-b` is the current page. | ||
|
|
||
| * Good, because the referrer header is automatically set by the browser, so the implementation of this is straightforward. | ||
| * Good, because it is minimally intrusive to the user and would not require any additional cookies or tracking. | ||
| * Bad, because the referrer header is not always set (e.g. if the user navigates directly to a page, or if the user has certain privacy settings enabled). | ||
| * Bad, because it does not capture specific user journeys, only page-to-page transitions. | ||
Bill-Haigh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * Good, because even though it does not capture specific user journeys, it will still allow us to generate a Sankey diagram that shows the most common page-to-page transitions / user flows. | ||
|
|
||
|
|
||
| #### Using the Session ID | ||
|
|
||
| Send a custom event to Plausible on each page load with the following: | ||
| 1. `"Flow": {props: {"page-a", "page-b", "session-id"}}` | ||
| 2. Where `page-a` is the referrer, `page-b` is the current page, and `session-id` is a unique identifier for the user's session. | ||
| 3. The session ID would be passed through a one-way hash function to ensure that it is not possible to identify the user. | ||
|
|
||
| * Good, because it would allow us to capture specific user journeys, rather than just page-to-page transitions. | ||
| * Good, because it would allow us to filter out duplicate page views within a session, which would give us a more accurate picture of user flows. | ||
| * Bad, because it could potentially raise privacy concerns, even if the session ID is hashed. | ||
| * Bad, because it would require additional implementation work to hash the session ID and manage the hashing process. | ||
Oops, something went wrong.
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.
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.
And a reminder to update this before you merge.