Skip to content

Commit 9b10ed5

Browse files
Update fastly.md
1 parent 3770245 commit 9b10ed5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/proxy/guides/fastly.md

+10
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,20 @@ return(pass);
6767

6868
You can now replace your Plausible Analytics script tag in the Header (`<head>`) section of your site with the proxied snippet. This is how the new snippet should look like (make sure to edit it to have the correct domain name of your site):
6969

70+
```html
71+
<script defer data-domain="yourdomain.com" src="/js/script.js"></script>
72+
```
73+
74+
In case of a subdirectory installation, you'll also need to add a `data-api` attribute to tell the script where the data should be sent.
75+
7076
```html
7177
<script defer data-domain="yourdomain.com" data-api="/plsbl/api/event" src="/plsbl/js/script.js"></script>
7278
```
7379

7480
Are you using our extensions such as hash-based routing, revenue or outbound link click tracking? Change the file name from `script.js` to the script you want to use: `script.hash.js`, `script.revenue.js` or `script.outbound-links.js`. Want to use more than one extension? You can chain them like this: `script.hash.revenue.outbound-links.js`.
7581

82+
Deploy these changes to your site. You can verify the proxy is working by opening your network tab. You should see a request to `https://yourdomain.com/js/script.js` with status 200 and another one to `https://yourdomain.com/api/event` with status 202.
83+
7684
That's it! You're now counting your website stats using a proxy.
85+
86+
Thanks to Lynden Jones for creating this guide!

0 commit comments

Comments
 (0)