BuySellAds Content Portal

Setting Up a Custom Ad Serving Template

Last Updated on August 22, 2016

(Note: This tutorial is for setting up ad templates for BSA-served ads. If you are setting up a template for DFP, please see this article.)

The first step for creating a new template is to come up with the markup and CSS for the ad. Let’s take this simple structure and style:




In this example, we have a few elements that can be replaced with variables:

  • URL
  • Title
  • Description

In your account, head over to Ad Serving Templates. Then click on the “Create New Template” button.

On that page, make sure that the Ad Server selected is “Serve Directly with BSA” then give the template a name.

Click on “Add Field”, and this will open up a modal window where you can define your variables. Let’s start with the URL. Each variable has a Name, a Type and some options like Default, Constraints, File Type, Tracking, Help Text, and Required — depending on the “Type” selected in the dropdown. For example, selecting Image will reveal File Types, while selecting URL will display Default and Constraints. In the case of the URL, it would look something like this:

Notice that Default is empty, but you could add https:// to this field. The Default input defines what the input field on the front-end for the advertiser will display by default as the “value”.

Once you’ve finished adding your variables, it will look something like this:

Notice that you now have access to the Variables. Those can then be used in your markup, like this:


The last step is to enter your markup and CSS into the Ad Code field, like this:

The code pasted into the Ad Code field:



Then simply save the Ad Template.

If you’ve created Variables but are not using them in your markup, our system will throw an error. All the variables you create need to be used in your markup (It’s also useful to catch typos in variable names.)

Then it’s just a matter of creating a new Ad Zone and selecting this new template in the Template dropdown:

That’s it!