Support > Publisher > Integrate Adverts with Javascript

Integrate Adverts with Javascript (#2103)

(Last Update: 31.03.2021)

You can create your individual Javascript advert tag in the user interface under [[Implementation]]. This is a pretty easy task. Simply ad a few details and copy the final code into your website. Our system will return adverts in an asynchronous (non-blocking) mode, meaning your website loading will not be affected. Adverts will be injected as soon as a response from our adserver is received. That usually happens pretty quick.

A. Example Code for Native Text Adverts

<script type="text/javascript" data-params="jsads">
     m3ads_system = "Solads";
     m3ads_partnernumber = 1234; // Your Publisher ID
     m3ads_containerclass = "M3Adverts"; // Name of Advert Container
     m3ads_sectors = "2007"; // Use Single Channel Number only
     m3ads_numberadverts = 10; // Number of Adverts
     m3ads_includeimages = 1; // Logo on/off
     m3ads_logoimagewidth = 90; // Logo Width
     m3ads_logoimageheight = 53; // Logo Height
     m3ads_cssurl = "mypath/mystyles.css"; // Path to your stylesheet
     m3ads_subpartner = "subpartner01"; // SubID-String
</script>
<script type="text/javascript" src="//cdn.feed.solads.media/resources/scripts/jsAds-1.4.min.js">
</script>

B. Example Code for Banner Adverts

<script type="text/javascript" data-params="jsads">
     m3ads_system = "Solads";
     m3ads_partnernumber = 1234; // Your Publisher ID
     m3ads_sectors = "2009"; // Use Single Channel Number only
     m3ads_numberadverts = 1; // Number of Adverts, use 1 here
     m3ads_imagewidth = 300; // Banner Width
     m3ads_imageheight = 250; // Banner Height
     m3ads_subpartner = "subpartner01"; // SubID-String
</script>
<script type="text/javascript" src="//cdn.feed.solads.media/resources/scripts/jsAds-1.4.min.js">
</script>

The following options are available to customize your tag:

Parameter
Function
Details
m3ads_partnernumber
Your Publisher ID
Enter your publisher id here so activity can be tracked against your account.
m3ads_sectors
Submit Channel ID
Enter a channel id here. Please use a separate tag for each individual channel. Note that channel ids for 'Native Ads CPC' and 'Banner CPM' are always different.
m3ads_numberadverts
Define max number of adverts
m3ads_subpartner
Submit Sub-Partner String
this can be an individual string, eg for a subpartner, a subsite or a specific section of your site
m3ads_publishertracking
3rd Party Click Tracking (recommended)
Optional, for custom click tracking. The click through URL, IP address and chargeability flag are sent as POST data to the 3rd party tracking service. For correct tracking in Google DFP please use the DFP click macro %%CLICK_URL_UNESC%%.
m3ads_3rdpartyclickurl
3rd Party Click Tracking with Click Forwarding (deprecated)
Optional, for custom click tracking. Usually requires own parameter (e.g., tracking =) for the campaign click url, which is appended to the adserver URL. The click is sent to the 3rd party adserver, which then does its processing and forwards on to the advertiser landing page. This mechanism is vulnerable to mistakes in the chain of clicks and the availability of the tracking server. Failures result in the browser not arriving at the advertiser's website and clicks not being registered. We recommend to use m3ads_publishertracking.
m3ads_referrer
Track page URL against site table
The parameter can be used to record traffic from a particular site against your site table if it is not possible to pass the referrer via the request header. Please note that data is only recorded if a suitable entry has been created in the site table beforehand. The value of this parameter does not replace the real referrer sent to the system.
m3ads_consent
Pass user consent
Declare if you have user consent to enable processing of Personally Identifiable Information (PII) as per Regional Data Regulation Laws. Values are 1 for consent or 0 for no consent. Default value if empty or not defined is 0 (no consent).

Only relevant for display adverts

Parameter
Function
Details
m3ads_imagewidth
Banner width in Pixel
m3ads_imageheight
Banner height in Pixel
m3ads_bidfloor_cpm
Minimum Bid for Banners
Required Minimum Bid in EUR cents, e.g. 0.35

Only relevant for text adverts

Parameter
Function
Details
m3ads_includeimages
Turn images on/off
1 = on. 0 = off
m3ads_logoimagewidth
Image width in pixel
m3ads_logoimageheight
Image height in pixel
m3ads_cssurl
Path to your css file
Define path to your own css file if you want to apply your invidual styling
m3ads_containerclass
Class of Advert Container
Class of Advert Container as defined in your CSS

Only relevant for Interstitial

Parameter
Function
Details
m3ads_autohide
Time in seconds until interstitial layer is closed automatically
0 to disable autohide
m3ads_lifetime
Time in minutes before the layer is shown again to the same user
Any number or "session" to show interstitial once per browser session.