react-code-dataset / wp-calypso /client /lib /analytics /utils /should-report-omit-site-main-product.js
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
const SITE_FRAGMENT_REGEX = /\/(email|mailboxes|checkout|domains|purchases|plans|view)(\/)*/i;
/**
* Check if a path should report the current selected site's main product (`site`, `domain` or `email`)
*
* Some paths should not report it because it's used for creating funnels to study
* only email and purchase activities.
* @param {string} path The tracked path.
* @returns {boolean} If the report should null `site_main_product`.
*/
export default ( path ) => {
if ( ! path ) {
return true;
}
return ! SITE_FRAGMENT_REGEX.test( path );
};