Skip to content
Merged
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
1 change: 1 addition & 0 deletions docs/integration-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 2 additions & 1 deletion docs/nextjs-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<CtaBox
headline="Add privacy-first analytics to your Next.js app"
headline="Add privacy-friendly analytics to your Next.js app. Try Plausible free for 30 days, no credit card required."
link="https://plausible.io/register"
linkText="Start free trial"
platform="Next.js"
/>

## Serving the Plausible script
Expand Down
47 changes: 47 additions & 0 deletions docs/odoo-integration.md
Original file line number Diff line number Diff line change
@@ -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

<CtaBox
headline="Connect your Odoo website to Plausible Cloud. Try it free for 30 days, no credit card required."
link="https://plausible.io/register"
linkText="Start free trial"
platform="Odoo"
/>

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.
4 changes: 2 additions & 2 deletions docs/plausible-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<CtaBox
headline="Need your site-specific snippet? Add your site to Plausible first"
headline="Add your website to Plausible to get your tracking snippet. Try it free for 30 days, no credit card required."
link="https://plausible.io/register"
linkText="Create free account"
linkText="Start free trial"
/>

<div class="browser">
Expand Down
10 changes: 10 additions & 0 deletions docs/register-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ Don't see this email in your inbox? Please check your spam folder and whether yo
</div>

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.
3 changes: 2 additions & 1 deletion docs/wordpress-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<CtaBox
headline="Privacy-first analytics for your WordPress site, no cookies and no consent banner"
headline="Get privacy-friendly analytics for your WordPress site with our official plugin. Try Plausible free for 30 days, no credit card required."
link="https://plausible.io/register"
linkText="Start free trial"
platform="WordPress"
/>

## Install the plugin
Expand Down
19 changes: 3 additions & 16 deletions src/components/CtaBox.js
Original file line number Diff line number Diff line change
@@ -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 (
<div className="cta-box">
<p>{headline}</p>
<div className="cta-box-actions">
<a href={link} className="cta-box-primary" style={{color: '#ffffff'}} onClick={() => track(link)}>
<a href={link} className="cta-box-primary" style={{color: '#ffffff'}} data-cta-position="Inline" data-cta-platform={platform}>
{linkText}
</a>
{secondaryLink && (
<a href={secondaryLink} className="cta-box-secondary" style={{color: 'var(--ifm-color-primary)'}} onClick={() => track(secondaryLink)}>
<a href={secondaryLink} className="cta-box-secondary" style={{color: 'var(--ifm-color-primary)'}} data-cta-position="Inline" data-cta-platform={platform}>
{secondaryText}
</a>
)}
Expand Down
10 changes: 1 addition & 9 deletions src/components/PlanFeatureNote.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="plan-feature-note">
<span className="plan-feature-badge">{planLabel}</span>
Expand All @@ -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}
</a>
Expand Down
4 changes: 2 additions & 2 deletions src/theme/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ export default function Footer() {
<a
href="https://plausible.io/register"
className={styles.ctaPrimary}
onClick={() => window.plausible && window.plausible('CTA Click', {props: {position: 'Bottom', type: 'Docs', button: 'Start free trial'}})}
data-cta-position="Bottom"
>
Start free trial
</a>
<a
href="https://plausible.io/plausible.io"
className={styles.ctaSecondary}
onClick={() => window.plausible && window.plausible('CTA Click', {props: {position: 'Bottom', type: 'Docs', button: 'View live demo'}})}
data-cta-position="Bottom"
>
View live demo
</a>
Expand Down
4 changes: 2 additions & 2 deletions src/theme/NavbarItem/CustomLoginStatusNavbarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function CustomLoginStatusNavbarItem({ mobile }) {
return (
<>
<a href="https://plausible.io/register" className="navbar__item navbar__link"
onClick={() => window.plausible && window.plausible('CTA Click', { props: { position: 'Nav', type: 'Docs', button: 'Start free trial' } })}>
data-cta-position="Nav">
Start free trial
</a>
<a href="https://plausible.io/login" className="navbar__item navbar__link">
Expand Down Expand Up @@ -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
</a>
Expand Down
41 changes: 27 additions & 14 deletions static/js/tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
});
}
Loading