Custom HTML ads on wix website

Hello,
I recently made a site, and it’s a local news site about cars. Now I want to add an ad for a local car dealership that would pay my company a sum for me putting their ad on the site. Is there a way to use custom HTML5 ads on wix? I’m pretty new to all of this so any help would be appreciated.
Thanks in advance.

Hey @sezakolimk , I’m currently working on pretty much the same thing, except its with a Lightbox pop up. What I would do in your place, is create an image template box with the dimensions you want the ad to be. Then connect that image to a dataset, which connects to a database called “Advertisements”, and that dataset will pull out the AD image and URL from the database sent to you by the car dealership.

If you want the Custom AD image box to generate ads at random from your database (if you display multiple ads), then you can add this into your page code:

import wixWindow from 'wix-window';
import wixData from 'wix-data';

$w.onReady(async function () {

 // Check the render cycle so this is just done once.
 // Otherwise, server-side will render, and then the image
 // switches to the image that the client-side rendered.
 if (wixWindow.rendering.renderCycle === 1) {
 let res = await wixData.query("AdvertisementImage").find(); //AdvertisementImage is the field in your database
 let items = res.items;
 let count = items.length;   // how many images do we have?
 let rnd = Math.floor(Math.random() * count);
 $w('#adimage').src = items[rnd].image;  // get a random image
 $w(‘#adimage').link = items[rnd].url; // get the url for that image
    }
});

Also take a look at this flyer that shows the standard banner sizes used for Ads.

Want to buy the car of your dreams, but not enough money for it? Then maybe you should consider a used car of the same model. If you are interested, you can do it on this site https://vehileaks.com/idaho . I’m sure that you will be able to find a quality car