Skip to main content

Step 1: Get Your Axo Script

  1. Go to the menu on the top right and navigate to Settings
  2. Click Sites.
  3. Select the site you wish to integrate, or create one if you haven’t already.
  4. Go to Install, then copy the embed script.

Step 2: Add the Axo Script to Your Discourse Theme

You’ll be embedding the Axo script into your site’s <head> by editing your Discourse theme. Here’s the easiest and cleanest method:
  1. Go to your Discourse Admin Panel.
  2. Navigate to Customizeand then to Themes.
  3. Choose the theme you’re using.
  4. Click Edit CSS/HTML.
  5. Switch to the <head> tab.
  6. Paste your Axo script at the bottom.
  7. Click Save.

Step 3: Ignore Canonicals and Enable SPA Tracking

Because Discourse comes with a canonical link to your homepage baked into the default/core setup, you’ve got to deactivate the use of canonical links.
Since Discourse is a single-page app (SPA), which means it dynamically loads new content without reloading the page, you have to enable SPA mode.
  1. Go to the menu on the top right and navigate to Settings
  2. Click Sites.
  3. Select the site you wish to integrate.
  4. Deactivate the Use canonicals checkbox.
  5. Set Single Page Application (SPA) mode to auto.
  6. Click Save.

Step 4: Test Your Setup

  1. Open your Discourse forum in another window.
  2. Visit your Axo Analytics dashboard.
  3. You should start seeing real-time page views.
Note: If you’re not seeing any data appear in your dashboard, ensure that you have any ad-blockers or VPNs you’re using temporarily disabled, as they may be blocking the Axo script.