Tracking Subdomains

Tracking subdomains can be a challenge for many tracking solutions, including Google Analytics and Matomo. If your business operates across multiple subdomains, such as a marketing website at `example.com` and a main application at `app.example.com`, accurately tracking user behavior and conversions becomes even more difficult.

With Proxima Analytics, however, you can overcome these challenges and effectively monitor user activity across all subdomains.

Setup

To effectively track subdomains with Proxima Analytics, you can create a new website through the dashboard and use the main subdomain, such as `website.com`. While adding the tracking script to your HTML will enable tracking for the main domain, subdomains such as `awesome.mywebsite.com` and `amazing.website.com` may not record pageviews. This is because Proxima checks the incoming traffic against the base URL, so it's important to properly set up tracking for each subdomain.

To ensure effective it is necessary to modify the tracking script. This can be done by adding the base domain as a `data-hostname` attribute in the script. The updated script should look like this:

<script
  defer
  src="https://buzz.proxima.so/script.js"
  data-hostname="website.com"
  data-site="XXXX"></script>

By adding the base domain in this manner, Proxima will now be able to capture all subdomains and display them in the statistics dashboard.