Basic Install

There are two steps to installing Optimize tags on your website.

Step 1: Embedding the JavaScript Code

For your non-AMP pages where you intend to display ads, you'll need to add the JavaScript code that allows the ad to load and display. You can find the tags specific to your website here: https://sell.buysellads.com/zones/optimize/ad-tags.

This script should get placed right before the closing </head> tag of your HTML pages. Ensure it's added to all non-AMP pages where you plan to show ads. Even if there are multiple ads on a page, you only need to insert this script once.

<script type="text/javascript">
		var bsa_optimize=document.createElement('script');
		bsa_optimize.src='https://cdn4.buysellads.net/pub/[YOUR_ACCOUNT_LABEL].js?'+(new Date()-new Date()%600000);

Step 2: Placing the Ad Tag and CSS

You can include the CSS specific to each ad zone in your own CSS file. Below is just a sample, please grab the specific styles for your zone(s) here: https://sell.buysellads.com/zones/optimize/ad-tags.

	@media only screen and (min-width: 0px) and (min-height: 0px) {
		div[id^="bsa-zone_[YOUR_ZONE_ID]"] {
			min-width: 0px;
			min-height: 0px;
	@media only screen and (min-width: 640px) and (min-height: 0px) {
		div[id^="bsa-zone_[YOUR_ZONE_ID]"] {
			min-width: 728px;
			min-height: 90px;

Include the HTML tag for each zone where you would like it to appear on your website.

<div id="bsa-zone_[YOUR_ZONE_ID]"></div>