We're considering changing the domain of the website we're using on our Mixpanel account. This will move the site to a page on an existing site on our main domain, which has significantly more traffic. Can we exclude events that happen on the main domain and only measure visitors who arrive on the page path of the new page that's replacing the existing site?
Hi James S., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đ
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
Yes, you can exclude events from the main domain and focus only on visitors to your specific page path using several methods in Mixpanel, depending on whether you want to prevent the data from being tracked at all or simply filter it out of your reports.
1. SDK Configuration (Blocking at the Source)
If you are using the JavaScript SDK with Autocapture enabled, you can use block_url_regexes to prevent Mixpanel from automatically tracking events on specific pages or patterns. This is useful if you want to ensure traffic from the main domain does not clutter your project [Mixpanel SDKs: Javascript].Alternatively, you can use logic in your initialization script to only initialize Mixpanel (or use a specific token) when the user is on the desired path: LBKS// Only initialize Mixpanel if the path matches your new page if (window.location.pathname.startsWith('/your-new-page-path')) { mixpanel.init('YOUR_PROJECT_TOKEN'); }LBKS[Separate Development Data]
2. Data Views (Restricting Visibility)
If data from the entire domain is already being sent to the project, you can use Data Views to create a segmented environment. This allows you to apply a filter (e.g., URL Path contains /your-page-path) so that specific users or teams only see data relevant to that page [Plan Data Access and Visibility].
3. Report Filtering (Analysis Level)
Within Mixpanel reports (like Insights or Funnels), you can use Global Filters to narrow down your analysis to only show users who interacted with your specific path:
** Global Filter: Add a filter where the property Current URL Path (or $current_url) contains your specific page path [Reports Overview].
** Funnels: You can use an Inline Filter on the first step of a funnel to ensure users only enter the funnel if they started on your new page path [Funnels Advanced Concepts].
4. Hiding Events
If there are specific events triggered on the main domain that you do not want to see in your menus, you can Hide them in Lexicon. This won't stop the data from being ingested, but it will remove them from the query builder and report results [Lexicon: Hiding Data].
kapa.ai is still learning and improving, please let me know how I did by reacting below.
âšī¸Â Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
