Publishers Code

AdFalcon offers Javascript solution for smartphone websites. If you are sure that your site will only be viewed over smartphone devices, you can use the JavaScript integration solution. Otherwise we recommend integrating with AdFalcon network using the server side web integration method explained in the sections below.

Contents

FunctionDescription
adFalcon(key, parameters) key A string containing unique key for an instance in whole page. parameters An object containing AdFalcon required and optional parameters this function containing a set of member variables and functions these members using to load and render the ads. you do not use these members directly; you just create an instance of AdFalcon function, then use the coming member function to load and render the ads.
loadAd()this function is a member function for AdFalcon that is used to load and render the ads.

How to use

To use AdFalcon JavaScript you will need to create three simple script sections as follows:

  • The first script defining a variable object “adFalconParameters “ that holds the required and optional parameters. The variable name can be named after your naming conventions.
  • The second script is responsible for loading AdFalcon JavaScript file from this path: http://www.adfalcon.com/static/js/adfalcon-web-all-1.0.0.js

Note: We highly recommend setting the previous two scripts in the header of HTML page.

  • Third script is responsible for:

    • Creating a new instance of adFalcon(key, parameters) where

      • key A string containing unique key for the instance in whole page.
      • parameters An object containing adFalcon parameters which have defined in the previous point (B).
    • Loading and rendering the ad using loadAd() member method.

Javascript


<header>
.
.
.
<!-- this section declares the parameters for adFalcon JavaScript, you find these parameters in AdFalcon Mobile Web API document in Appendix A -->

<script type="text/javascript">
var adFalconParameters =
{
    R_SID: "Site ID"
    , R_TM: true
    //Extra optional parameters
    //, R_AS:1 //If particular Ad size is requested; otherwise ignore it.
    //, R_UUID:"UUID" // If you maintain a unique user id for each user, then provide it here.
    //, U_LN: “ar”
    //,U_AGE: 27
    //,U_G: m
    //,U_KW: “sport, music”
    //,U_CC: “JO”
    //,U_AC: “962”
    //,U_PC: “11121”
    //,D_LA:35.654
    //,D_LO:34.054
    
    
}
</script>

<!--this section loads JavaScript of AdFalcon -->

<script type="text/javascript" src="http://www.adfalcon.com/static/js/adfalcon-web-all-1.0.0.js">
</script>
.
</header>
<body>
.
.
<!--Creating new instance of adFalcon function and load the ad-->

<script type="text/javascript">
     var adFalconInstance1 = new adFalcon("unique key for this instance", adFalconParameters );
     adFalconInstance1.loadAd();
</script>
.
.