Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subdomain analytics #90

Open
thibaultleouay opened this issue Aug 2, 2023 · 8 comments
Open

Subdomain analytics #90

thibaultleouay opened this issue Aug 2, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@thibaultleouay
Copy link

For openstatus we allow users to create subdomain hosted under our own domain

They are rewritten using next middleware

Is it possible to track this subdomain ?
Maybe with before send function?

Does the event contains the full request hostname ?

@tobiaslins
Copy link
Collaborator

We're already tracking the full hostname but we don't expose a hostname filter/domain selector yet. Do you want to filter for a specific domain eg my.custom-domain.com and see all the pageviews/events from it?

@thibaultleouay
Copy link
Author

yep that would do the job,
I want to be able to differentiate the page views from our landing page www.openstatus.dev -> page / and custom-domain.openstatus.dev -> page /

What i thought of doing was something like these

<Analytics
  beforeSend={(event) => {
    if (event.host.includes('www')) {
      return event;
    } else {
    return {
      ...event,
      url: `/domain/${event.host}/${url.toString()}`,
    };;
    }
  }}
/>

@thibaultleouay
Copy link
Author

This is how I managed it

https://github.com/openstatusHQ/openstatus/blob/main/apps/web/src/app/_components/analytics.tsx

In order to catch the custom subdomain

Their might be a better way ?

@tobiaslins
Copy link
Collaborator

@thibaultleouay looks good. for now this is the only way to "see" that data. We'll let you know once we add support for hostnames!

@nikl216
Copy link

nikl216 commented Jan 4, 2024

Hey, is there an update on this yet?
I want to track analytics for a multi-tenant app. how do i do this ?
Also the openstatus github link isn't working. Could you explain on how i can achieve this currently ?

@thibaultleouay
Copy link
Author

@feugy feugy added the enhancement New feature or request label Feb 21, 2024
@diego-lipinski-de-castro

+1 for this feature, filter analytics by subdomain

@everettglovier
Copy link

im using multiple TLDs on a single project for localization (.com, .de, .fr) and cannot differentiate them in the analytics. this would be a very beneficial feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants