diff --git a/docs/authors.md b/docs/authors.md index 6e398752..3cb1cebf 100644 --- a/docs/authors.md +++ b/docs/authors.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Our team --- diff --git a/docs/buttondown.md b/docs/buttondown.md index 69f70a20..41257fb2 100644 --- a/docs/buttondown.md +++ b/docs/buttondown.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to add the script to Buttondown --- diff --git a/docs/carrd-integration.md b/docs/carrd-integration.md index 95efd8f6..aa40d2a8 100644 --- a/docs/carrd-integration.md +++ b/docs/carrd-integration.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Adding Plausible to Carrd (and tracking custom events) --- diff --git a/docs/community-integrations.md b/docs/community-integrations.md index ccea0592..682d57d0 100644 --- a/docs/community-integrations.md +++ b/docs/community-integrations.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Community integrations --- diff --git a/docs/contribute.md b/docs/contribute.md index 7a5ed229..76a04780 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to contribute --- diff --git a/docs/custom-automatic-link-tracking.md b/docs/custom-automatic-link-tracking.md index 0cb95443..9334a443 100644 --- a/docs/custom-automatic-link-tracking.md +++ b/docs/custom-automatic-link-tracking.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Tracking clicks on cloaked affiliate links and other pretty URLs --- diff --git a/docs/custom-domain.md b/docs/custom-domain.md index c2a3f6a2..55c04ed6 100644 --- a/docs/custom-domain.md +++ b/docs/custom-domain.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Serve the script from your domain as a first-party connection --- diff --git a/docs/custom-locations.md b/docs/custom-locations.md index 132108a1..5e96337f 100644 --- a/docs/custom-locations.md +++ b/docs/custom-locations.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Specify a custom location to aggregate pages that contain identifiers --- diff --git a/docs/custom-pageview-props.md b/docs/custom-pageview-props.md index 6e8eccb8..05f5a1b6 100644 --- a/docs/custom-pageview-props.md +++ b/docs/custom-pageview-props.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Custom properties for pageviews --- diff --git a/docs/custom-query-params.md b/docs/custom-query-params.md index 5e790795..7fc8197d 100644 --- a/docs/custom-query-params.md +++ b/docs/custom-query-params.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Tracking custom query parameters --- diff --git a/docs/data-pipelines.md b/docs/data-pipelines.md index 58f4bdeb..b58738a9 100644 --- a/docs/data-pipelines.md +++ b/docs/data-pipelines.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Viewing Plausible stats elsewhere --- diff --git a/docs/discourse-integration.md b/docs/discourse-integration.md index 6be737f8..198640da 100644 --- a/docs/discourse-integration.md +++ b/docs/discourse-integration.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to add the script to your Discourse community --- diff --git a/docs/docusaurus-integration.md b/docs/docusaurus-integration.md index f2860af2..de88349d 100644 --- a/docs/docusaurus-integration.md +++ b/docs/docusaurus-integration.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to add the script to your Docusaurus site --- diff --git a/docs/excluding-localstorage.md b/docs/excluding-localstorage.md index ea93d2a2..f18af851 100644 --- a/docs/excluding-localstorage.md +++ b/docs/excluding-localstorage.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Opt out and exclude your visits from the analytics by setting a localStorage flag in your browser --- diff --git a/docs/excluding-pages.md b/docs/excluding-pages.md index 6f1a3450..fb09fb0c 100644 --- a/docs/excluding-pages.md +++ b/docs/excluding-pages.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Exclude specific pages from being tracked --- diff --git a/docs/get-started-with-postman.md b/docs/get-started-with-postman.md index 8922f448..d16c6f5f 100644 --- a/docs/get-started-with-postman.md +++ b/docs/get-started-with-postman.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to get started with the Stats API using Postman --- diff --git a/docs/ghost-integration.md b/docs/ghost-integration.md index 869a14ae..b4051466 100644 --- a/docs/ghost-integration.md +++ b/docs/ghost-integration.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to add the script to your Ghost site --- diff --git a/docs/google-tag-manager.md b/docs/google-tag-manager.md index 11481e28..3baa431b 100644 --- a/docs/google-tag-manager.md +++ b/docs/google-tag-manager.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to add the script to your site using Google Tag Manager --- diff --git a/docs/hash-based-routing.md b/docs/hash-based-routing.md index d2368c12..3f318d2c 100644 --- a/docs/hash-based-routing.md +++ b/docs/hash-based-routing.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Hashed page paths --- diff --git a/docs/hubspot-analytics.md b/docs/hubspot-analytics.md index caa25d71..a4723cd9 100644 --- a/docs/hubspot-analytics.md +++ b/docs/hubspot-analytics.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to add Plausible Analytics to your HubSpot site --- diff --git a/docs/hugo-integration.md b/docs/hugo-integration.md index ed560d1a..1401a951 100644 --- a/docs/hugo-integration.md +++ b/docs/hugo-integration.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to add the script to your Hugo site --- diff --git a/docs/internal-link-click-tracking.md b/docs/internal-link-click-tracking.md index 59d231a8..d8d37fea 100644 --- a/docs/internal-link-click-tracking.md +++ b/docs/internal-link-click-tracking.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Internal link click tracking --- diff --git a/docs/javascript-snippet.md b/docs/javascript-snippet.md index 43822d17..f9a3bb81 100644 --- a/docs/javascript-snippet.md +++ b/docs/javascript-snippet.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Where do I find my JavaScript snippet? --- diff --git a/docs/manual-link-tagging.md b/docs/manual-link-tagging.md index d7fe6a3d..1b058062 100644 --- a/docs/manual-link-tagging.md +++ b/docs/manual-link-tagging.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Paid campaigns, UTM tags and conversion attribution --- diff --git a/docs/mediawiki-integration.md b/docs/mediawiki-integration.md index 1fff970f..eadccd95 100644 --- a/docs/mediawiki-integration.md +++ b/docs/mediawiki-integration.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to add Plausible to your MediaWiki instance --- diff --git a/docs/nextjs-integration.md b/docs/nextjs-integration.md index 9fd7a3ab..6ab74705 100644 --- a/docs/nextjs-integration.md +++ b/docs/nextjs-integration.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: How to add the script to your NextJS site --- @@ -10,7 +11,7 @@ You can add the script directly to your head through "next/head" or react-helmet ## Serving the Plausible script -```jsx +```jsx title="pages/index.jsx" import PlausibleProvider from 'next-plausible' export default Home() { @@ -25,7 +26,7 @@ export default Home() { ## Sending custom events -```jsx +```jsx title="components/PlausibleButton.jsx" import {usePlausible} from 'next-plausible' export default PlausibleButton() { diff --git a/docs/plausible-analytics-reviews.md b/docs/plausible-analytics-reviews.md index 823a8667..71816b38 100644 --- a/docs/plausible-analytics-reviews.md +++ b/docs/plausible-analytics-reviews.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Plausible Analytics reviews and in media --- diff --git a/docs/plausible-analytics-self-hosted-guides.md b/docs/plausible-analytics-self-hosted-guides.md index b6592fa3..7165f839 100644 --- a/docs/plausible-analytics-self-hosted-guides.md +++ b/docs/plausible-analytics-self-hosted-guides.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Plausible Community Edition (CE) --- diff --git a/docs/proxy/guides/akamai.md b/docs/proxy/guides/akamai.md index fee69999..21bd2255 100644 --- a/docs/proxy/guides/akamai.md +++ b/docs/proxy/guides/akamai.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Proxying Plausible through Akamai --- diff --git a/docs/proxy/guides/apache.md b/docs/proxy/guides/apache.md index 3688caf7..9e459284 100644 --- a/docs/proxy/guides/apache.md +++ b/docs/proxy/guides/apache.md @@ -10,7 +10,7 @@ Our managed proxy lets you send analytics through your own domain name as a firs ## Step 1: Enable the required modules -``` +```bash sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod ssl @@ -32,7 +32,7 @@ the snippet specific for your site. It will look similar to the following: Your snippet will have a different script location than the example above. Look for the `https://plausible.io/js/pa-XXXXX.js` part in your snippet - that's the personalized location for your site's script. Mark it down for subsequent steps. ## Step 3: Update your config -``` +``` title="apache-vhost.conf" ServerName website.com diff --git a/docs/proxy/guides/caddy.md b/docs/proxy/guides/caddy.md index a7faec51..7b18ce80 100644 --- a/docs/proxy/guides/caddy.md +++ b/docs/proxy/guides/caddy.md @@ -28,7 +28,7 @@ Your snippet will have a different script location than the example above. Look Add the following to your Caddyfile: -``` +``` title="Caddyfile" @plausible path /js/script.js /api/event handle @plausible { # Use path from step 1 diff --git a/docs/proxy/guides/cloudflare.md b/docs/proxy/guides/cloudflare.md index 429fd5e4..4b58690f 100644 --- a/docs/proxy/guides/cloudflare.md +++ b/docs/proxy/guides/cloudflare.md @@ -21,7 +21,7 @@ In your Cloudflare account, click on the "Compute (Workers" > 'Workers & Pages' ## Step 2 (Optional): You can change your service name -This is optional but you can change the service name to give your worker a more meaningful name. Do avoid words like 'plausible', 'analytics', 'tracking', 'stats', etc. as they may be blocked. It's also fine to keep the random name that Cloudflare generates by default. Then click on the 'Deploy' button. +This is optional but you can change the service name to give your worker a more meaningful name. It's also fine to keep the random name that Cloudflare generates by default. Then click on the 'Deploy' button. Deploy CloudFlare worker @@ -46,7 +46,9 @@ Next click on the 'Edit Code' button, remove the default code that Cloudflare pr Edit CloudFlare worker -We recommend you change the folder name in the first two lines in the code below. This makes your proxy more difficult to discover and block. We especially recommend you change the folder name in the two lines if you're not hosting your site on the Cloudflare CDN. +:::tip +Change the folder name in the first two lines of the code below. This makes your proxy harder to discover and block, especially if you're not hosting your site on the Cloudflare CDN. +::: In the **ProxyScript** line, change `https://plausible.io/js/pa-XXXXX.js` to your script location from step 3. @@ -54,9 +56,11 @@ In the **ScriptName** line, change the `/js/` to whatever you wish. Say `/your-f In the **Endpoint** line, change the `/api/` to whatever you want. It can be the same as above but you can also choose something different. If you choose `/your-folder-name/`, then the full location would be `/your-folder-name/event`. -Do avoid words like 'plausible', 'analytics', 'tracking', 'stats', etc. as they may be blocked. +:::warning +Avoid words like 'plausible', 'analytics', 'tracking', 'stats' in path names as they may be blocked. +::: -```js +```js title="cloudflare-worker.js" const ProxyScript = 'https://plausible.io/js/pa-XXXXX.js' const ScriptName = '/js/script.js'; const Endpoint = '/api/event'; diff --git a/docs/proxy/guides/cloudfront.md b/docs/proxy/guides/cloudfront.md index 6caa0322..d2f1a974 100644 --- a/docs/proxy/guides/cloudfront.md +++ b/docs/proxy/guides/cloudfront.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Proxying Plausible through CloudFront --- diff --git a/docs/proxy/guides/deno.md b/docs/proxy/guides/deno.md index e1611a0c..bc276f1c 100644 --- a/docs/proxy/guides/deno.md +++ b/docs/proxy/guides/deno.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Proxying Plausible through Deno Deploy --- diff --git a/docs/proxy/guides/fastly.md b/docs/proxy/guides/fastly.md index 0caa9c8c..ee8a4313 100644 --- a/docs/proxy/guides/fastly.md +++ b/docs/proxy/guides/fastly.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Proxying Plausible through Fastly --- diff --git a/docs/proxy/guides/fresh.md b/docs/proxy/guides/fresh.md index 7cdadb5f..91de1b65 100644 --- a/docs/proxy/guides/fresh.md +++ b/docs/proxy/guides/fresh.md @@ -1,4 +1,5 @@ --- +displayed_sidebar: someSidebar title: Proxying Plausible through Fresh --- diff --git a/docs/proxy/guides/laravel.md b/docs/proxy/guides/laravel.md index dc91cdc1..d987e9a6 100644 --- a/docs/proxy/guides/laravel.md +++ b/docs/proxy/guides/laravel.md @@ -29,7 +29,7 @@ php artisan make:controller PlausibleProxyController Add the following code to the controller, replacing `https://plausible.io/js/pa-XXXXX.js` with the script location from Step 1. -```php +```php title="app/Http/Controllers/PlausibleProxyController.php" name('plausible.script'); Route::post('/api/event', [PlausibleProxyController::class, 'event'])->name('plausible.event'); ``` -Note that: - -- You can use whatever paths you like here. Do choose generic names. If you choose something like `analytics`, `stats` or `plausible`, it may get blocked. +:::warning +Use generic path names. Paths like `/analytics`, `/stats` or `/plausible` may get blocked by adblockers. +::: ## Step 4: Exempt the event route from CSRF -The Plausible script sends POST requests to the event endpoint, which Laravel's CSRF protection will block by default. +:::warning +Laravel's CSRF protection will block POST requests to the event endpoint by default. This step is required for tracking to work. +::: In your `bootstrap/app.php` file, add the event route to the CSRF exceptions: -```php +```php title="bootstrap/app.php" ->withMiddleware(function (Middleware $middleware) { $middleware->validateCsrfTokens(except: [ 'api/event', // Add this line @@ -104,7 +106,7 @@ In your `bootstrap/app.php` file, add the event route to the CSRF exceptions: Add the script tags to your application's HTML ``, configuring the `src` and `endpoint` to match the named route from Step 3: -```blade +```blade title="layout.blade.php"