Hector Analytics

Install Tracking Script

Now that you've added your website, it's time to install the tracking script. This lightweight script (under 2KB) will start collecting privacy-friendly analytics data immediately.

Get Your Tracking Script

  1. Go to your website's settings in the dashboard
  2. Click on the "Installation" tab
  3. Copy your unique tracking script

Your script will look something like this:

<script src="https://www.hectoranalytics.com/script.js" defer></script>

Installation

Before Closing Body Tag

Place the script just before the closing </body> tag:

<!DOCTYPE html>
<html>
  <head>
    <title>Your Website</title>
  </head>
  <body>
    <!-- Your content -->

    <!-- Hector Analytics -->
    <script src="https://www.hectoranalytics.com/script.js" defer></script>
  </body>
</html>

Platform-Specific Guides

WordPress

Plugin

Puglin for WordPress coming soon.

React/Next.js

Add to your main layout or _app.js:

import Head from "next/head";

export default function MyApp({ Component, pageProps }) {
  return (
    <>
      <Head>
        <script
          async
          src="https://analytics.hectoranalytics.com/script.js"
          data-website-id="your-unique-id"
        />
      </Head>
      <Component {...pageProps} />
    </>
  );
}

Vue.js

Add to your main index.html or in the app component:

<!-- In public/index.html -->
<head>
  <script
    async
    src="https://analytics.hectoranalytics.com/script.js"
    data-website-id="your-unique-id"
  ></script>
</head>

Gatsby

Add to gatsby-ssr.js or gatsby-browser.js:

export const onRenderBody = ({ setHeadComponents }) => {
  setHeadComponents([
    <script
      key="hector-analytics"
      async
      src="https://analytics.hectoranalytics.com/script.js"
      data-website-id="your-unique-id"
    />,
  ]);
};

Shopify

  1. Go to Online Store → Themes
  2. Click "Actions" → "Edit code"
  3. Open theme.liquid
  4. Add the script before </head>

Webflow

  1. Go to Project Settings → Custom Code
  2. Paste the script in "Head Code"
  3. Publish your site

Advanced Configuration

Custom Domain (Self-hosted)

If you're self-hosting Hector Analytics:

<script
  async
  src="https://your-domain.com/script.js"
  data-website-id="your-unique-id"
></script>

Environment-Specific Tracking

For different environments (dev, staging, prod):

<!-- Development -->
<script
  async
  src="https://analytics.hectoranalytics.com/script.js"
  data-website-id="dev-site-id"
></script>

<!-- Production -->
<script
  async
  src="https://analytics.hectoranalytics.com/script.js"
  data-website-id="prod-site-id"
></script>

What the Script Does

The Hector Analytics script:

Tracks page views automaticallyCollects visitor metrics (location, device, browser)Records referral sourcesMeasures session durationDetects and filters bot trafficWorks without cookiesRespects Do Not Track headersAnonymizes IP addresses

Does NOT collect personal dataDoes NOT use cookies by defaultDoes NOT track across websitesDoes NOT slow down your site

Performance Impact

  • File size: Under 2KB gzipped
  • Load time: Asynchronous, non-blocking
  • Bandwidth: Minimal data transmission
  • Privacy: No cookies, no personal data

Troubleshooting

Script not loading?

  • Check that the URL is correct
  • Verify your website ID
  • Ensure there are no ad blockers interfering

No data appearing?

  • Wait a few minutes for data to process
  • Check that you're visiting the correct domain
  • Verify the script is in the <head> section

Ready to Verify?

Great! Now let's verify your installation to make sure everything is working correctly.


🔒 Privacy Note: The script automatically anonymizes all data and respects user privacy preferences. No personal information is collected or stored.