-
Notifications
You must be signed in to change notification settings - Fork 49
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
Capture search terms in playbook analytics #1181
Merged
Merged
Conversation
This file contains 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
✅ Deploy Preview for laughing-payne-b9fbd2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
lookupdaily
force-pushed
the
capture-search-terms
branch
4 times, most recently
from
July 20, 2023 16:29
5ff5006
to
7741854
Compare
lookupdaily
changed the title
WIP: Capture search terms in playbook analytics
Capture search terms in playbook analytics
Aug 17, 2023
lookupdaily
force-pushed
the
capture-search-terms
branch
from
August 18, 2023 08:21
7741854
to
540aa5a
Compare
adamhughes86
approved these changes
Aug 18, 2023
yndajas
approved these changes
Aug 18, 2023
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.
I don't know how Plausible works (trust you and Adam on that!), but have a few quick tidy up suggestions
By default Plausible strips query params from urls to count page views. We want to track search terms via the 'query' tag. To do this we will need to switch to using the manual Plausible script, and define a function to manually trigger events. This adds the custom plausible page view script from docs
lookupdaily
force-pushed
the
capture-search-terms
branch
from
August 21, 2023 17:25
540aa5a
to
eea52f9
Compare
Add plausible entrypoint to webpack config
lookupdaily
force-pushed
the
capture-search-terms
branch
from
August 21, 2023 17:33
eea52f9
to
613c120
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds the ability to track common search terms on the playbook using our analytics tool Plausible.
This is related to issue #1024 and was a suggestion from the content team. In order to inform future content changes (e.g. restructures), it might be useful to have some kind of analytics to track common search terms. This has two benefits:
By default Plausible strips query params from urls to count page views. We can however, use a custom script to capture query parameters, and track them as page views in Plausible.
How it works
By creating a 'Goal' for the
/search*
url in the Plausible dashboard, we can still view the total number of visitors to the search page. When clicking on the goal, common terms are listed as pages under the 'Top pages' section. Common search terms will also be listed under general page views, but this is an easy way to view them together.Things to note
Special characters
This solution currently only handles spaces in search terms, and joins them together using a '-'. It does not remove other special characters. However, special characters are shown on the plausible dashboard (see example below). It is also worth noting that search itself does not currently handle special characters. This does mean that there may be more variations of the same or similar terms though - which might create additional work when analysing the top terms.
What's next
We are also looking ways to understand if people are finding what they're looking for on the playbook. One suggestion is to add a button on the search page to let users let us know themselves (linked to a simple form).