Skip to content

Update 404 tracking examples #621

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
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/error-pages-tracking-404.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Your Plausible tracking snippet should be inserted into [the Header (`<head>`) s
Add this code to your 404 page. For instance, if you're using WordPress, your 404 page template will be called `404.php`. It will be located within your theme files.

```html
<script>document.addEventListener('DOMContentLoaded', function () { plausible('404', { props: { path: document.location.pathname } }); });</script>
<script>document.addEventListener('DOMContentLoaded', function () { plausible('404'); });</script>
```

You can place this code anywhere in the `<head>` or `<body>` section of your 404 page template.
Expand Down
2 changes: 1 addition & 1 deletion docs/google-tag-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ That's it! Now you can go to your website and verify whether Plausible Analytics
5. Create a new GTM Tag called "**Page Not Found Tag**" of type "**Custom HTML**" and paste the following code:

```javascript
<script type="text/javascript">window.plausible("404", { props: { path: document.location.pathname } });</script>
<script type="text/javascript">window.plausible("404");</script>
```

6. Publish all changes.
Expand Down