We are currently rendering two types of Ads on our front pages.
Afrique, Arabic, Hindi, Mundo, Portuguese, Russian, Zhongwen
Given you are using Chrome browser.
-
Download ModHeader Chrome extension
-
With the ModHeader extension, add a header of
BBC-Adverts
with the valuetrue
. -
Download the CORS Unblock Chrome extension to prevent any CORS errors related to https://www.test.bbc.com/userinfo which would prevent the ads to display correctly.
-
Run local environment:
yarn dev
. If you would like to run with Simorgh's CSP Headers, run the following command:yarn build && yarn start
-
Visit the home page of one of the services with Ads enabled and append this query string to the url:
?site=test&ads-debug=true
Given you do not have any ad blocking extensions in your browser.
-
Use a proxy to set your location outside the UK. Visiting https://www.test.bbc.com/userinfo should show
"X-Ip_is_advertise_combined": "yes"
. And when you visit https://www.test.bbc.com/mundo you should be able to see an advert. -
If you would like to see the ads with the debugger tool you can append this query string to the url:
?ads-debug=true
If you are unable to set a proxy on one of the Windows a11y laptops, you won't be able to see ads within the UK. For this reason, you'll have to run Simorgh locally on your working machine and allow the Windows laptop to connect to it over LAN with the following steps:
-
Connect both devices to the same network
-
Update the
SIMORGH_PUBLIC_STATIC_ASSETS_ORIGIN
url in the local.env file with the IP address of your machinee.g.
SIMORGH_PUBLIC_STATIC_ASSETS_ORIGIN=http://192.168.0.50:7080
-
Disable the
upgrade-insecure-requests
directive from the cspHeader -
If you can't set the
BBC-Adverts
header in the Windows laptop, you will need to remove this condition from the codebase to be able to render the ad -
Run Simorgh with a production build
yarn build && yarn start
-
Connect to your machine running Simorgh using the Windows laptop by visiting the IP address of it appended with the correct query strings
e.g.
http://192.168.0.50:7080/mundo?site=test&ads-debug=true
You can append this query string ?ads-js-env=live
to your URL to load the LIVE dotcom-bootstrap
for canonical pages only.
e.g. https://www.test.bbc.com/mundo?ads-js-env=live
We know the existence of a minor intermittent issue in the local environment which prevents the correct rendering of the leaderboard ad. Reloading the page a couple of times with cache disabled, should allow you to see the leaderboard ad.
Another minor intermittent issue in the local environment occurs when trying to render ads at different breakpoints. In this case, reloading the page might not be enough, and you should try rendering the ad using another page data.