-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Analytics: Remove problematic "blacklist"/"whitelist" language …
- Loading branch information
1 parent
890e235
commit eb93e48
Showing
7 changed files
with
32 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
client/lib/analytics/utils/is-url-blacklisted-for-performance.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import debug from './debug'; | ||
|
||
// For better load performance, these routes are blacklisted from loading ads. | ||
const blacklistedRoutes = [ '/log-in' ]; | ||
|
||
/** | ||
* Are tracking pixels forbidden from the given URL for better performance (except for Google Analytics)? | ||
* | ||
* @returns {boolean} true if the current URL is blacklisted. | ||
*/ | ||
export default function isUrlBlacklistedForPerformance() { | ||
const { href } = document.location; | ||
const match = ( pattern ) => href.indexOf( pattern ) !== -1; | ||
const result = blacklistedRoutes.some( match ); | ||
|
||
debug( `Is URL Blacklisted for Performance: ${ result }` ); | ||
return result; | ||
} |
21 changes: 0 additions & 21 deletions
21
client/lib/analytics/utils/is-url-excluded-for-performance.js
This file was deleted.
Oops, something went wrong.