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

Passing --blocked-url-patterns in config.json #8

Open
goranculibrk opened this issue Apr 12, 2019 · 2 comments
Open

Passing --blocked-url-patterns in config.json #8

goranculibrk opened this issue Apr 12, 2019 · 2 comments

Comments

@goranculibrk
Copy link

Hi there,
I'm trying to pass an argument to the lighthouse, which would block Google Analytics.
Here's the code from config.json.

"lighthouseFlags": { "output": ["html", "csv"], "emulatedFormFactor": "desktop", "blocked-url-patterns": [ "*www.google-analytics.com/analytics.js*" ] }

Based on Lighthouse documentation, it's possible to pass that argument. I've tried passing just the URL, without brackets, it didn't work, then I tried using the brackets without the asterisk and it didn't help. Any idea how to block requests for this url: www.google-analytics.com/analytics.js?

My goal is to perform audit reports but without notifying google analytics about it, since running 100-200 tests on websites that have maybe 1, 2000 monthly visitors would mess the data.

@goranculibrk
Copy link
Author

Actually, after a little bit of digging, figured it out. I was using blocked-url-patterns instead of blockedUrlPatterns.
The full code that's working properly from what I can see is:

"lighthouseFlags": { "output": ["html", "csv"], "emulatedFormFactor": "desktop", "blockedUrlPatterns": [ "www.google-analytics.com/analytics.js" ] }

@danderson421
Copy link

You could just filter your traffic from analytics...

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

No branches or pull requests

2 participants