From 6d9a49377135fa3ba429a18a8726c377fcc39604 Mon Sep 17 00:00:00 2001 From: Marko Saric Date: Tue, 13 Oct 2026 12:28:55 +0200 Subject: [PATCH] cta fixes --- docs/integration-guides.md | 1 + docs/nextjs-integration.md | 3 +- docs/odoo-integration.md | 47 +++++++++++++++++++ docs/plausible-script.md | 4 +- docs/register-account.md | 10 ++++ docs/wordpress-integration.md | 3 +- src/components/CtaBox.js | 19 ++------ src/components/PlanFeatureNote.js | 10 +--- src/theme/Footer/index.js | 4 +- .../NavbarItem/CustomLoginStatusNavbarItem.js | 4 +- static/js/tracking.js | 41 ++++++++++------ 11 files changed, 99 insertions(+), 47 deletions(-) create mode 100644 docs/odoo-integration.md diff --git a/docs/integration-guides.md b/docs/integration-guides.md index 35a272f5..dc5391b8 100644 --- a/docs/integration-guides.md +++ b/docs/integration-guides.md @@ -70,6 +70,7 @@ Step-by-step guides for popular website builders and content management systems. | [Ghost](ghost-integration.md) | Guide | How to add the script to your Ghost site | | [HubSpot](hubspot-analytics.md) | Guide | How to add the script to your HubSpot site | | [Hugo](hugo-integration.md) | Guide | How to add the script to your Hugo site | +| [Odoo](odoo-integration.md) | Guide | Connect your Odoo website to Plausible Cloud | | [NextJS](nextjs-integration.md) | Guide | Simple integration for Plausible Analytics and NextJS with custom events | | [Shopify](shopify-integration.md) | Guide | How to add the script to your Shopify store | | [Squarespace](squarespace-integration.md) | Guide | How to add the script to your Squarespace site | diff --git a/docs/nextjs-integration.md b/docs/nextjs-integration.md index a0e406d0..249843b5 100644 --- a/docs/nextjs-integration.md +++ b/docs/nextjs-integration.md @@ -13,9 +13,10 @@ You can add the script directly to your head through "next/head" or react-helmet **[Next-Plausible](https://github.com/4lejandrito/next-plausible)** built and maintained by [4lejandrito](https://github.com/4lejandrito). It supports: ## Serving the Plausible script diff --git a/docs/odoo-integration.md b/docs/odoo-integration.md new file mode 100644 index 00000000..6d2c2123 --- /dev/null +++ b/docs/odoo-integration.md @@ -0,0 +1,47 @@ +--- +title: Using Plausible Cloud with Odoo +sidebar_label: Odoo +description: "Connect your Odoo website to Plausible Cloud, view analytics inside Odoo and check that your tracking works." +--- + +import CtaBox from '@site/src/components/CtaBox'; + +Use Plausible Cloud to see where your Odoo website visitors come from, which pages they visit and which actions they take. Plausible handles the analytics hosting and updates for you. + +This guide focuses on connecting your website to your account at **plausible.io**, whether you use Odoo Online, Odoo.sh or an on-premise installation. Menu names and installation steps can vary by Odoo version. + +## 1. Create your account and add your website + + + +Already have an account? [Sign in](https://plausible.io/login) and [add your website](add-website.md). Use the domain people visit, such as `example.com`. + +## 2. Connect Odoo to Plausible Cloud + +For Odoo Online, Odoo documents these system parameters for connecting to Plausible Cloud. Enable developer mode, then open **Settings → Technical → System Parameters** and set: + +| Key | Value | +| --- | --- | +| `website.plausible_server` | `https://plausible.io` | +| `website.plausible_script` | `https://plausible.io/js/plausible.js` | + +For the installation sequence that applies to your environment, follow Odoo's website analytics instructions: [Odoo 19](https://www.odoo.com/documentation/19.0/applications/websites/website/reporting/analytics.html), [Odoo 18](https://www.odoo.com/documentation/18.0/applications/websites/website/reporting/analytics.html) or [Odoo 16](https://www.odoo.com/documentation/16.0/applications/websites/website/reporting/analytics.html). Select your version in Odoo's documentation if it isn't listed here. + +When using Odoo’s built-in integration, configure it to use Plausible Cloud and your Cloud shared link. This changes the integration’s destination; you do not need to add a second Plausible snippet manually or through Google Tag Manager. If you previously added a separate snippet that sends to the same Plausible Cloud site, remove that extra installation to avoid duplicate pageviews and events. + +## 3. View your dashboard inside Odoo + +In Plausible, open your website's **Settings → Visibility** and create a [shared link](shared-links.md). Leave password protection off: Odoo's embedded dashboard does not support it. + +In Odoo, open **Website → Configuration → Settings**, select the correct website, enable **Plausible Analytics**, paste the link into **Shared Link Auth** and save. You can then open **Website → Reporting → Analytics**. + +Shared links require a plan that includes them. Your trial includes Business features; see [plans](subscription-plans.md). Anyone with the shared link can view that site's dashboard, so keep it out of public posts and screenshots. + +## 4. Check that visits appear + +Open your website and check its dashboard in Plausible Cloud. Confirm that you're looking at the same domain in both systems. If visits don't appear, check the configured server and installation before adding another script. See [troubleshooting](troubleshoot-integration.md) for more checks. diff --git a/docs/plausible-script.md b/docs/plausible-script.md index d35d20dc..e4358aab 100644 --- a/docs/plausible-script.md +++ b/docs/plausible-script.md @@ -16,9 +16,9 @@ Click on the menu icon on the right-hand side of the site you'd like to get the There you can also enable any [optional enhanced measurements](script-extensions.md).
diff --git a/docs/register-account.md b/docs/register-account.md index d7c40234..cd734f9f 100644 --- a/docs/register-account.md +++ b/docs/register-account.md @@ -28,3 +28,13 @@ Don't see this email in your inbox? Please check your spam folder and whether yo
Once verified, your 30-day trial starts immediately. [Register your account →](https://plausible.io/register) + +## Next: connect your website + +After verification, [add your website](add-website.md), then use the guide for your setup: + +- [WordPress: install and connect the official plugin](wordpress-integration.md) +- [Google Tag Manager: use the official template](https://plausible.io/gtm-template) +- [Other platforms and installation methods](integration-guides.md) + +Finish by checking that your site is receiving traffic. Creating an account alone does not start collecting visits. diff --git a/docs/wordpress-integration.md b/docs/wordpress-integration.md index 704ed201..771a5bf5 100644 --- a/docs/wordpress-integration.md +++ b/docs/wordpress-integration.md @@ -13,9 +13,10 @@ The best way to add Plausible to your WordPress site is our official plugin. It This page covers everything the plugin can do. If you only want a quick start, the first two sections (install and connect) are all you need. ## Install the plugin diff --git a/src/components/CtaBox.js b/src/components/CtaBox.js index 2c51b8fc..eb9f007d 100644 --- a/src/components/CtaBox.js +++ b/src/components/CtaBox.js @@ -1,35 +1,22 @@ import React, { useState, useEffect } from 'react'; -export default function CtaBox({ headline, link, linkText, secondaryLink, secondaryText }) { +export default function CtaBox({ headline, link, linkText, secondaryLink, secondaryText, platform }) { const [loggedIn, setLoggedIn] = useState(false); useEffect(() => { setLoggedIn(document.cookie.includes('logged_in=true')); }, []); - const canonicalButton = (href) => { - if (href && href.includes('/register')) return 'Start free trial'; - if (href && href.includes('/plausible.io')) return 'View live demo'; - return null; - }; - - const track = (href) => { - const button = canonicalButton(href); - if (button && typeof window !== 'undefined' && window.plausible) { - window.plausible('CTA Click', { props: { position: 'Inline', type: 'Docs', button } }); - } - }; - if (loggedIn) return null; return (

{headline}

- track(link)}> + {linkText} {secondaryLink && ( - track(secondaryLink)}> + {secondaryText} )} diff --git a/src/components/PlanFeatureNote.js b/src/components/PlanFeatureNote.js index 2f542a20..c1af1f01 100644 --- a/src/components/PlanFeatureNote.js +++ b/src/components/PlanFeatureNote.js @@ -7,14 +7,6 @@ export default function PlanFeatureNote({ feature, plan, label }) { const link = isBusiness ? 'https://plausible.io/#pricing' : 'https://plausible.io/contact'; const linkText = isBusiness ? 'Compare plans →' : 'Contact us →'; - const button = isBusiness ? 'Compare plans' : 'Contact us'; - - const track = () => { - if (typeof window !== 'undefined' && window.plausible) { - window.plausible('CTA Click', { props: { position: 'Inline', type: 'Docs', button } }); - } - }; - return (
{planLabel} @@ -25,7 +17,7 @@ export default function PlanFeatureNote({ feature, plan, label }) { href={link} className="plan-feature-link" style={{ color: 'var(--ifm-color-primary)' }} - onClick={track} + data-cta-position="Inline" > {linkText} diff --git a/src/theme/Footer/index.js b/src/theme/Footer/index.js index 87feab77..b5f3facb 100644 --- a/src/theme/Footer/index.js +++ b/src/theme/Footer/index.js @@ -53,14 +53,14 @@ export default function Footer() { window.plausible && window.plausible('CTA Click', {props: {position: 'Bottom', type: 'Docs', button: 'Start free trial'}})} + data-cta-position="Bottom" > Start free trial window.plausible && window.plausible('CTA Click', {props: {position: 'Bottom', type: 'Docs', button: 'View live demo'}})} + data-cta-position="Bottom" > View live demo diff --git a/src/theme/NavbarItem/CustomLoginStatusNavbarItem.js b/src/theme/NavbarItem/CustomLoginStatusNavbarItem.js index 9e1f4d95..0e817d63 100644 --- a/src/theme/NavbarItem/CustomLoginStatusNavbarItem.js +++ b/src/theme/NavbarItem/CustomLoginStatusNavbarItem.js @@ -17,7 +17,7 @@ export default function CustomLoginStatusNavbarItem({ mobile }) { return ( <> window.plausible && window.plausible('CTA Click', { props: { position: 'Nav', type: 'Docs', button: 'Start free trial' } })}> + data-cta-position="Nav"> Start free trial @@ -56,7 +56,7 @@ export default function CustomLoginStatusNavbarItem({ mobile }) { href="https://plausible.io/register" className="button button--primary" style={btnStyle} - onClick={() => window.plausible && window.plausible('CTA Click', { props: { position: 'Nav', type: 'Docs', button: 'Start free trial' } })} + data-cta-position="Nav" > Start free trial diff --git a/static/js/tracking.js b/static/js/tracking.js index bd754db1..911cab93 100644 --- a/static/js/tracking.js +++ b/static/js/tracking.js @@ -9,17 +9,30 @@ plausible.init({ } }) -document.addEventListener('click', function(e) { - var a = e.target.closest('a'); - if (!a) return; - var href = a.getAttribute('href') || ''; - var button = null; - if (href.indexOf('plausible.io/register') !== -1) { - button = 'Start free trial'; - } else if (href.indexOf('plausible.io/plausible.io') !== -1) { - button = 'View live demo'; - } - if (button) { - plausible('CTA Click', {props: {position: 'Inline', type: 'Docs', button: button}}); - } -}); +// One delegated handler also covers Markdown links and client-side navigation. +if (!window.plausibleDocsCtaTracking) { + window.plausibleDocsCtaTracking = true; + document.addEventListener('click', function(e) { + var a = e.target.closest && e.target.closest('a'); + if (!a) return; + var url; + try { url = new URL(a.getAttribute('href'), window.location.href); } + catch (_) { return; } + if (url.origin !== 'https://plausible.io') return; + var path = url.pathname.replace(/\/$/, '') || '/'; + var button; + if (path === '/register') button = 'Start free trial'; + else if (path === '/plausible.io') button = 'View live demo'; + else if (path === '/' && url.hash === '#pricing') button = 'See pricing'; + else if (path === '/contact') button = 'Contact us'; + else return; + var props = { + position: a.getAttribute('data-cta-position') || 'Inline', + type: 'Docs', + button: button + }; + var platform = a.getAttribute('data-cta-platform'); + if (platform) props.platform = platform; + window.plausible && window.plausible('CTA Click', {props: props}); + }); +}