Skip to content

Commit

Permalink
Update Plausible script to manually trigger page view events
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lookupdaily committed Jul 20, 2023
1 parent 3cd8435 commit 3b72afe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
{% endif %}

<link rel="stylesheet" href="/assets/main.css" />
<script defer data-domain="playbook.dxw.com" src="https://plausible.io/js/plausible.js"></script>
<script defer data-domain="playbook.dxw.com" src="https://plausible.io/js/script.manual.js"></script>
<!-- define the `plausible` function to manually trigger events - as the pageview event is not being sent automatically with 'script.manual.js' -->
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
</head>
<body>
{% include navbar.html %}
Expand Down

0 comments on commit 3b72afe

Please sign in to comment.