Skip to content

Home Services

Client Side

Setup

MyAdOptimizer.com will provide a Javascript snippet back to you to add to your new Thank You page as follows:

<script src="https://cdn.myadoptimizer.com/maojsfiles/landingpagesjs/{{LandingPageToken}}.js"></script>
  • LandingPageToken: Token that will be provided by your account manager
  • Div Element: Aggregated results will be rendered automatically once the thank you page loads on the user browser. An HTML DIV element with ID=“target” must be created in the Thank-You page as results will be rendered inside that element.
  • Default CSS Theme: MyAdOptimizer provides a default CSS; however, if you wish to change it and create your own to match your landing page theme, please contact your account manager
  • Device Type (Desktop or Mobile): This is automatically inferred when using Client Side (JavaScript) integration

To ensure that each ad network gets the parameter values they require we ask that you setup a new Thank You page and pass the below parameters in the query string. The aggregated results will be rendered once they Thank You page loads on the user’s browser.


Generic Query String Parameters

  • SourceID: Optional, tracking variable

  • ExtClickID: Optional, tracking variable

  • CustomVar1: Optional, tracking variable (Max length - 75)
  • CustomVar2: Optional, tracking variable (Max length - 75)
  • CustomVar3: Optional, tracking variable (Max length - 75)
  • CustomVar4: Optional, tracking variable (Max length - 75)
  • CustomVar5: Optional, tracking variable (Max length - 75)

Specific Query String Parameters for Home Services

Params NamesData TypeAllowed Values
ZipCode*string5 char US zip code
State*string2 char US state code (Uppercase)
ProjectServiceType*stringRoofing, Gutters, Windows/Doors, Kitchen/Bathroom, Home Security, Pest Control, Lawn Care
ProjectTypesConcentration*string
Roofing Asphalt Only, Tile Only, Metal Only, Foam Only, Tar & Gravel Only, Wood Shingles Only, Slate Only
Gutters Residential, Commercial
Windows/Doors1 to 10 Windows, 1 to 10 Doors
Kitchen/BathroomBathroom Remodel, Walk-In Shower Only, Walk-In Tub Only, Bathtub to Shower Only, Kitchen Remodel
Home SecuritySecurity Intrusion, Fire Detection
Pest ControlBugs/Insects, Rodents, Birds/Bats, Small Animals, Termites, Ants, Bees/Wasps, Fleas, Spiders
Lawn CareLandscaping, Lawn Care, Gardening, Sod Installation, Tree Planting, Artificial Turf Installation
ProjectScope*stringReplace New, Repair Existing, Other
ProjectTimeline*stringImmediate, Within 2 weeks, Within 1 month, Unsure
HomeOwner*stringYes, No
Gender*stringMale, Female, Other
Married*stringYes, No
MilitaryStatus*stringYes, No
Ageinteger1 - 99
SolarPowerBill*integer$0 - $99, $100 - $149, $150 - $199, $200 - $249, $250 - $349, $350 - $399, $400 - $449, $450 - $499, $500 - $1000+
SolarRoofingType*stringFull Sun, Partially Shaded, Mostly Shaded, Not Sure
FName ±string
LName ±string
Email ±string
Phone ±string
Address ±string
City ±string
MediaChannelstringSocial, Facebook, Native, Email, Display, SEM, SEO, SMS, Push, Affiliate, ChannelA, ChannelB, ChannelC, ChannelD, ChannelE

*Case Sensitive

±PII Fields - These values are not constraints and will not be evaluated by MAO

LocalStorage Integration

In order to use LocalStorage instead Querystring, set up the parameters names & values stated above by adding them using a MAO JS function called setMAOLocalStorageValue. This method expects a key/value pair.

The function setMAOLocalStorageValue need two paramets

  • Property name & Property value

For example:

/*
@param{string} sParam - Property Name
@param{*} sValue - Property Value
*/
setMAOLocalStorageValue('State', CA);
setMAOLocalStorageValue('ZipCode', 90291);
// Output: Added value succesfully

Once you have set up all parameters values, you need to invoke the function initMAO to render all campaigns.

initMAO function need two parameters

  • Target HTML ID & Render mode For Example:
//HTML Structure
<div id="target"> Rendered campaings ... </div>
/*
@param{string} TargetHtmlControlID
@param{number} GlobalRenderMode (1- Live , 2- Test)
*/
InitMAO('target', 1);

Click to call RenderMode 3

Callback properties

  • CampaignPhoneNumber: New A unique phone number assigned to the campaign to track and measure calls.

  • CallToAction: New Text displayed on a clickable button or element, encouraging users to initiate a phone call.

  • AdResultCallStatusID: New An ID representing the campaign’s call status, where:

IDStatusAllows calls
1Click To Call is ActiveTRUE
8Campaign is out of scheduleFALSE
13Click to Call Monthly Cap ReachedFALSE
14Click to Call Daily Cap reachedFALSE
15Click to Call is OffFALSE
16Campaign is offFALSE

Example Callback

{
"advertiserId": "100",
"AdvertiserName": "Advertiser Name 01 - 100",
"AdNetworkAPIID": 76,
"Title": "Fixed Mortgage Rates from 5.7 rate 6.1 Apr",
"AdCopyVersion": 1,
"Description": "FHA, VA, 30 Year Fixed, 15 Year Fixed <br /> Cash Out and Home Equity Options <br /> View Rates & Payments <br /> Calculate Home Equity Payments",
"CPC": 15.75,
"BaseCPC": 15,
"Logo": "https://cdn.myadoptimizer.com/maojsfiles/images/LogoAdvertiser_000000_00000000-0000-0000-0000-000000000000.jpg",
"BrandName": "Advertiser Name 01",
"NetworkSort": 1,
"NetworkAdID": "1284",
"DisplayUrl": "Advertiser Name 01.com/MortgageRates",
"PayLoad": "",
"Weight": 15.75,
"CB": "XXXXXXXXXXXXXXXXXXXXXXX",
"M": "XXXXXXXXXXXXXXXXXXXXXXX",
"BidModifierPercentange": 5,
"BidFloor": 0,
"RequestDuration": 539,
"AdResultLogStatusId": 1,
"AdNetworkName": "MAO Open Exchange",
"SourceID": "",
"ExtClickId": "",
"ExtSearchID": "",
"LandingPageURL": "ThankYouDemo.html",
"bidModDescription": [
"Consumer Credit: Excellent - Value: 5%"
],
"CustomVar1": "",
"CustomVar2": "",
"CustomVar3": "",
"CustomVar4": "",
"CustomVar5": "",
"DailyFilledRate": 0,
"CampaignDailyCap": 1500,
"CampaignPhoneNumber": "+11234567890",
"CallToAction": "Call Now",
"AdResultCallStatusID": 1,
"DestinationURL": "https://maofunctionstest.azurewebsites.net/api/MAOHttpRedirect?src=https%3A%2F%2Fwww.Advertiser Name 01.com%2Fmortgagerates%3Futm_source%3Ddirectbidder1284&LandingPageID=10&EventID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&AdNetworkAPIID=76&cpc=15.75&Brand=Advertiser Name 01&Title=Fixed Mortgage Rates from 5.7 rate 6.1 Apr&CB=XXXXXXXXXXXXXXXXXXXXXXX&M=XXXXXXXXXXXXXXXXXXXXXXX&Weight=15.75&BidModifiers=5&NetworkAdID=1284&SourceID=&LandingPageURL=ThankYouDemo.html&AdId=100&AdCopyVersion=1&CustomVar1=&CustomVar2=&CustomVar3=&CustomVar4=&CustomVar5=",
"findIndex": 0
}

External Ad Networks Setup Optional

To integrate the following Ad Networks, MAO will need the following values.

Media Alpha

  • api_token
  • placement_id

Transparent.ly

  • pubcampaignId

Clicks.NET

  • Affcamid
  • Key

Quinstreet

  • Src