Basically, we have a javascript integration on client's webpages. We don't have much (or any) control of the deployed environment, hence the only way to test our integration is truly working is using browser automation on the client's webpage. We don't want to interfere with our tracking and analytics, and more importantly, the client's analytics (which is very important to verifying their ROI). What is the most convenient and effective way to block Google Analytics in the context of selenium browser automation?
I have found a few approaches:
Editing the hosts file to redirect Google Analytics to localhost (I'm not too happy about this solution since in the past it has broken some of our integration files)
Other browser specific extensions, Block yourself from GA extension for Chrome and Google Disconnect for Firefox.