The Trainline Website vs Advert Blockers

We use a popular UK based website at work for booking train tickets – thetrainline.com. Recently we noticed that users were unable to perform advanced searches on the website, instead being told “Oops, something went wrong”. Not the most helpful of error messages! We could see a whole host of embedded advert/tracking/analytics websites being blocked at our proxy when users were performing the search, so I went through each one one-at-a-time to find out which was the one causing an issue. The search worked just fine off the corporate LAN, so it must have been one of our corporate security tools causing the problem. This is how it was done.

Using Chrome, browse to the site. Open the Developer tools (F12, or Menu -> More tools -> Developer tools) and look at the Network tab. Sort by the Status column to see which are failing to load:

How you do the next step depends on your network layout. As our issue was users on a corporate network behind a proxy, I tested from a computer which was not on the corporate LAN and therefore not behind the proxy. You could do it using tools your your local firewall/gateway, proxy or ZAProxy for testing. Or you could do it simply by editing your hosts file. I added each of the failed hosts to my hosts file pointing to 127.0.0.1. This replicated the fault on my computer off the corporate network. Then I removed them one at a time until the search worked. The culprit was delivery.g.switchadhub.com – adding that to our proxy whitelist fixed advanced searches on thetrainline.com – our proxy was blocking it under the category “Web Ads” as any advert blocker would.

Update: thetrainline.com don’t seem to be embedding javascript from delivery.g.switchadhub.com anymore, so this is no longer an issue. However I’m leaving this page here for future reference.

Leave a Reply

Your email address will not be published. Required fields are marked *