BuySellAds Content Portal

Other CMS Installations

Last Updated on July 8, 2016

These days, it’s highly unlikely that you’ll be installing our ad code on a site comprised of nothing more than flat files. If you’re running with a CMS, then the information throughout this page will help you integrate the BuySellAds ad code directly into your CMS of choice. Below is a series of quick tutorials aimed at the most used CMSes across the network of BuySellAds publishers.

Weebly Ad Code Installation

If you are using Weebly for your website, they offer an easy drag and drop method of adding code to your template.

Please review their tutorial about adding custom code for more details and screenshots. You will
just click on their “Embed Code” icon and then drag that where you want to paste the code.

  1. For our STEP 1 code, you will just drag the “Embed Code” icon just below the tag of your template. Then you will paste our STEP 1 code there.
  2. For our STEP 2 code, you will drag the “Embed Code” icon wherever you want that specific zone to appear in your template, and then paste the STEP 2 code there.
Important note: Please be sure that our STEP 1 code is just after the tag (or as high up in the body as possible). This code always needs to appear above any STEP 2 codes added.

How to Install Ad Code into a Squarespace Template

Squarespace offers a couple of ways to insert code into your template by default, although both of these methods do not allow for our STEP 1 code to be installed in the correct location.

Code Blocks are inserted into predefined locations in a template, and Code Injections only allow code in the header, footer, lock page or order confirmation page.

Our STEP 1 code needs to be installed just after the opening tag of a website, and there is currently not a way to insert code just after this tag with their default setup via Code Injections or Code Blocks. It is important to install this in the correct location to avoid issues with ad display and impression estimates.

You may still be able to install our ad code if you hire a Squarespace specialist to edit the template’s code using their Developer section.

Squarespace recommends these specialists for code edits such as this to ensure that things are edited properly. If you decide to hire a professional for this, please be sure to provide them with our code installation tutorial as well. 🙂

WordPress Installation

WordPress Plugin Installation

If you would like to install your ad code using our WordPress Plugin, please follow the instructions below. As always, you can contact our Support Department if you have any questions. 🙂

Important: If you initially used a manual installation and you are now using the plugin, please remove all previous BSA ad code, including the STEP 1 code under. If your STEP 1 code appears twice in a page on your live site (when viewing the source code in your browser), this will cause ad serving issues. STEP 1 code should only appear once in a page.

  1. First you will need to download the plug-in here and upload to your theme’s ‘wp-content/plugins‘ directory. You can also install directly from your dashboard by clicking on “Add New” under “Plugins” and searching for ‘BuySellAds‘ in the search box.
  2. After the plug-in is installed, you will need to activate it.
  3. Next you will need to locate the Site Key in your BuySellAds account. To do this, you will log in to your BSA account dashboard and then click on “Actions > Ad Code”  for one of your zones.
  4. On the Ad Code page, you will see a string of numbers and letters just after the “bsap_” part of the “Step 2” code. This is your site key.
  5. Copy the Site Key, and then go back to your WordPress account. Click on “BuySellAds” in your WordPress sidebar.
  6. In the “Site Key” field on that page, paste your site key.
  7. Then click on the “Save Settings” button.
  8. Display your ad zones via the widgets menu found in “Appearance > Widgets“.

That’s it! Please be sure to contact our Support Department if you have any questions. 🙂

Manual WordPress Installation

Here are the instructions to manually install your ad code into WordPress (if you are not using the plugin):

  • In WordPress templates within your theme’s files, there is usually a file called header.php that usually includes the opening tag – although this depends on the theme, so not all are setup this way. You just need to find your site’s opening tag. Then you place the STEP 1 code directly after that opening tag with nothing in between. This STEP 1 code should only appear once in each page that you have ad zones on. If you paste this STEP 1 code twice or more on a page, it may not display your ads.
  • Your STEP 2 ad zone code will go into a file that may be called header.php, footer.php, sidebar.php or similar – depending on where you want that specific zone to appear. You will repeat this step for each zone that you have – placing the code where you want each ad zone to appear.

I am using your WordPress plug-in, but the Step 1 code is missing, and the ads are not appearing.

There is a step in the plug-in installation in which you need to add a line of PHP code just beneath the opening body tag. The code below is what you will need to add just beneath your opening body tag:

This line of code is what adds the Step 1 code to your site. You will also want to be sure that this line of code is installed in the correct location just after the opening tag. If this is not installed in the correct location, it can also cause and display issues.

What is my Site Key for the WordPress Plugin?

You can find the site key from your Dashboard. To see it, log in via BuySellAds.com, click on your email address at the top of the page, and click “Dashboard“. Click the “Actions” dropdown next to one of your ad zones and click “Ad Code”.

Your site key is the part of the STEP 2 code without the “bsap_“. In this example, ‘4d23a9e08e0ab6a836a2b19f55a52e14‘ is the site key:

  • bsap_4d23a9e08e0ab6a836a2b19f55a52e14
Note: If you receive an error that the site key is invalid, this is usually because curl (or similar) isn’t enabled for the server you are on. You may want to check with your web hosting company about this, or you can install without the plug-in (manual installation) if that works better for your setup.

Smarty Templates

With Smarty, since they use curly brackets {} for template functions, you will need to tell Smarty to ignore the curly brackets in our main JavaScript snippet. To do this, simply wrap the BSA ad code that you put below the opening body tag with the {literal} template tag. So, when you add the BSA ad code it will look like this in your template file:

{literal}
 {literal}

How to Install Your Ad Code in a Genesis Theme

  1. First, you will need to install the Genesis Simple Hooks Plugin via manual installation or by using the plugin search in your dashboard. Then you will install and activate the plugin.
  2. After that is installed and activated, you will need to navigate to that plugin in the sidebar under “Genesis > Simple Hooks”.
  3. On that page you will scroll down to where it says “genesis_before Hook”. In the field under “genesis_before Hook”, you will add the STEP 1 code that is on your Ad Code page in your account. (Please copy and paste this code exactly as it is in the dashboard, with no edits or line breaks.)
  4. Then you will place your STEP 2 zone code in the hook where you want that specific zone to appear. For example, if you created a Sidebar zone that needs to appear in your sidebar, you will scroll down to the appropriate sidebar hook and paste the STEP 2 code there. Just do this for each zone you need to install and be sure to read the hook description to ensure you are pasting in the proper location. (Please copy and paste this code exactly as it is in the dashboard, with no edits or line breaks.)
  5. Then you will save these changes by clicking on the “Save Changes” button on that page, and your code will be installed. (The “Save Changes” button appears in several places on the hooks page. Just click on any of those buttons to save the changes you have made.)