20 likes | 56 Views
Semalt, semalt SEO, Semalt SEO Tips, Semalt Agency, Semalt SEO Agency, Semalt SEO services, web design, web development, site promotion, analytics, SMM, Digital marketing
E N D
23.05.2018 Semalt: Excluding Internal Tra?c From Selenium WebDriver In Google Analytics Once in a while, a site requires testing to determine optimization levels. Selenium WebDriver and Watir are among the automatic UI testing tools used. Developers should, therefore, make a point of putting into consideration that by accessing the site, they will also count as internal traf?c. It is prudent for them to exclude such traf?c from Google Analytics to prevent skewed reports. Julia Vaishnava, the Senior Customer Success Manager of Semalt, states that it is relatively easy to eliminate traf?c from Selenium if it is carried out in the testing environment. One can use GA tokens from production to separate the analytics data. The other method is to avoid adding the GA extension to a testing server. However, if the developer uses Selenium against production, there are a few ways through which one can exclude the traf?c generated by Google Analytics. Some require excluding speci?c traf?c, while others require a complete update of the Selenium test code. https://rankexperience.com/articles/article1405.html 1/2
23.05.2018 General Solutions 1. Exclude IP/ISP. 1. Exclude IP/ISP. The developer can create a custom ?lter for a particular IP address or a range of them, or the ISP to prevent recording internal traf?c. The steps to follow are: Select Admin, navigate to Filters and select Add Filter. Choose to Create New Filter and choose the custom feature. Look for the Exclude button and select it. Select IP Address from the ?lter ?eld and the IP address from the ?lter pattern. The method may also ?lter out traf?c that is not generated by Selenium as well. If the person conducting the tests uses a dynamic IP or distributed CI systems, maintaining all of them in Google Analytics may turn to be too tedious for them. 2. Edit Hosts File. 2. Edit Hosts File.One does not have to change the settings on Google Analytics. They can simply prevent traf?c from reaching the server. It means that they will have to edit the host's ?le on the machines used to run the tests. It involves adding or removing permissions for the testing environment. It blocks all traf?c from all sites, which is not an ideal thing to do for a site. Selenium Speci?c Solutions 1. Disable JavaScript. 1. Disable JavaScript. The tracking code used in Google Analytics is a JavaScript, and a reasonable solution would be to disable it so that GA does not record the traf?c. However, modern websites rely on JavaScript, which makes the answer not feasible unless the site of focus does not use it at all. Since Selenium relies on JavaScript, disabling the feature might lead to strange test results. 2. Set Custom User Agents. 2. Set Custom User Agents.The Wrap Site in Google Analytics makes it possible to create an if statement to ignore traf?c from some of the users using Selenium. It thus serves as another plausible solution to deal with the internal traf?c from Selenium tests. 3. Opt-out Plugins. 3. Opt-out Plugins.Google has of?cial plugins that give the site owner an option to opt-out of Google Analytics. If one installs the plugin, then Google does not collect or use any information from that site. Selenium does not start without custom add-ons installed, which means that one will have to add them manually. 4. Use Proxy. 4. Use Proxy.BrowserMob is a proxy used by developers as it has an option to blacklist. It comes in handy when blocking data sent to Google Analytics. https://rankexperience.com/articles/article1405.html 2/2