How do I integrate AdSpeed mobile ad serving API?This client library is used to fetch appropriate ad(s) from our mobile ad server and include the chosen ad code directly into your mobile website or mobile app. This approach requires downloading a client library and some programming knowledge from your side. It is suitable if:
- You want to target more mobile devices, including both smart-phones and basic mobile handsets.
- You want to rotate text ads, or a mix of both text and image ads
How it works
- Your website includes the client library to pre-fetch an ad
- Your website displays provided ad directly to end-users
DownloadDownload PHP class. Please visit this page frequently for updates or revisions.
Set Ad Serving ParametersThe client library can fetch ads from any zone or a specific ad. For serving ads in a zone, you will need the zone ID and additional selection parameters: ad format, ad dimension. Ad format can be:
- image banner ads only
- text link ads only
- or a mix between banners and text links
Sample CodeThis example shows how to use the provided PHP library to fetch and include an ad into your mobile website. It requires programming and technical integration on your side.
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html> <head> <title>Sample Mobile Site</title> </head> <body> <h4>Sample Content</h4> This is my test website optimized for mobile devices. It uses XHTML Mobile Profile (XHTML-MP) <ul> <li><a href="#link1">Test Link #1</a></li> <li><a href="#link2">Test Link #2</a></li> </ul> <h4>Advertisement</h4> Mixing banners and text link ads in a single ad placement. <?php include_once("AdSpeed.mobile.class.php"); $vAd = new AdSpeedAdServer(); $vAd->setFormat('text_image'); echo $vAd->fetch(array('zid'=>22922,'wd'=>-1,'ht'=>-1)); ?> </body> </html>Live Demo of ad serving on a test mobile page.
Other Articles in Ad Tag
This section describes the ad tag (serving code) with basic and advanced settings. It includes common ad serving setup instructions and answers frequently asked questions when integrating the ad tag into your site, blog or app.
- Can I have ads refresh automatically without a page reload?
- How can I avoid duplicate ads on the same page?
- How can I combine multiple ads in the same placement?
- How can I defer ads until after the page has finished loading?
- How can I display an ad only when it is visible on screen?
- How can I mix ad dimensions or mix banners with text-link ads?
- How can I put ads into my blog/website?
- How can I serve multiple ad dimensions in the same place?
- How can I serve multiple zones with a single server request?
- How can I support click tracking for external ad servers?
- How can I turn off ad serving error messages?
- How do I add current timestamp into the serving code?
- How do I display mobile ads using Android WebView?
- How do I make ads responsive on mobile devices?
- How do I pass custom data and variables into the ad?
- How do I set up advertising on WordPress?
- How do I setup a companion ad in video ad serving?
- How do I setup a passback ad tag?
- Should I use protocol-relative URLs in ad tags?
- What are custom ad serving settings and variables?
- What are different formats of serving code?
- What are different types of ad tag?
- What are interstitial ads?
- What are the effects of ad blocking software?
- What is the pop-up and pop-under ad tag?
- What is the serving code?
- What is WMODE for SWF ads? How can I change it?
- Where is the publisher-side file for iframe busting?
- Why doesn't the provided HTML serving code work?
Cannot find an answer for your question? Ask our Customer Care team
- Mobile Ad Serving
"Mobile ad serving is a natural extension for any web publishers and we are committed to provide you the tools ..."
- Mobile Interstitial Ad
"This is an ad template for a mobile interstitial ad. The user can click on a Close button to make ..."
- Mobile In-App Interstitial Ad with MRAID
"MRAID (Mobile Rich Media Ad Interface Definitions) is a common API that helps mobile ad creators and native mobile app ..."
- jQuery Popup Ad
"This is an ad template for a popup ad (also called a lightbox ad or an overlay ad). The user ..."