Skip to content

convertmedia/personalizedTagDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 

Repository files navigation

Personalized Tag Demo

Getting Started

  1. Replace the query string keys
  2. Place the tag script in the page
 <!-- BEGIN CONVERTMEDIA JS TAG -->
 <SCRIPT type="text/javascript" SRC="//15.basebanner.com/BidRHanSer?oid=15&width=2&height=2&pubid=INSERT_PUBLISHER_ID&tagid=INSERT_TAG_ID&pstn=ENTER_PLACEMENT_ID_HERE&noaop=1&revmod=INSERT_CONTENT_TYPE&encoded=1&cb=INSERT_CACHEBUSTER&keywords=INSERT_COMMA_SEPARATED_KEYWORDS&callback=document.write&urlonly=1"></SCRIPT>

Tag Personalization

add personalization confif script to the page

<script>
        window.cmTagConfig = {
            isDebug: true,
            onOutOfView: "detach"
        };
</script>

Options

unitType

accepts: "INLINE"/"INTERSTITIAL"/"SLIDER"
default: "INLINE"

window.cmTagConfig = {
   unitType:"INLINE"
}

isDebug

accepts: true/false
default: false

window.cmTagConfig = {
   isDebug:true
}

closeButton

hasCloseButton
accepts: true/fale
default: true
secondsToCloseButton
accepts: number 0...60
default: 5

window.cmTagConfig = {
   closeButton:{
     hasCloseButton:true,
     secondsToCloseButton:10
   }
}

Options For Inline Unit Only

onOutOfView

accepts: "none","pause","detach"
default:"pause"

window.cmTagConfig = {
   onOutOfView:"detach"
}

viewPercent

accepts: numbers 0...100
default:20

window.cmTagConfig = {
   viewPercent:50
}

parentSelector

accepts: js/css selector/ array of js/css selectors
default: no selector (the video will open next to the tag placement)

//one selector
window.cmTagConfig = {
   parentSelectr:"div.block.B3 > div:nth-child(1)"
}
//array of selectors
window.cmTagConfig = {
   parentSelectr:["article","#div1","div.block.B3 > div:nth-child(1)"]
}

Options For Interstital Unit Only

onClose

accepts:"detach"/"none"
default value:"none"

window.cmTagConfig = {
   onClose:"detach"
}

secondsToAd

accepts: number 0...60
default value:3

window.cmTagConfig = {
   secondsToAd:5
}

width

accepts: number 500...1000
default:900

window.cmTagConfig = {
   width:850
}

*the height is auto calculated

Options For Slider Unit Only

secondsToAd

accepts: number 0...60
default value:3

width

accepts: number 300...1000
default:402

position

horizontal
accepts:"right"/"left"
default:"right"
vertical
accepts: "top"/"middle"/"bottom"
defautl: "bottom"

window.cmTagConfig = {
   position:{
     horizontal:"right",
     vertical:"top"
   }
}

Upcoming Options (next release features)

onReady

accepts: callback

window.cmTagConfig = {
   onReady:function(){
     console.log("the adUnit is ready");
   }
}

onConversion

accepts: callback

window.cmTagConfig = {
   onConversion:function(){
     console.log("the adUnit is playing the video ad");
   }
}

onAdDone

accepts: callback

window.cmTagConfig = {
   onAdDone:function(){
     console.log("the adUnit is playing done playing the video ad ");
   }
}

onClosedByUser

accepts: callback

window.cmTagConfig = {
   onClosedByUser:function(){
     console.log("the user closed clicked on the close button");
   }
}

Example

<script>
        window.cmTagConfig = {
            isDebug: true,
            onOutOfView: "detach",
            demandConfig: {
                waterfall: {
                    "totalTimeout": 180,
                    "tags": [
                        {
                            pixel:"http://localhost/pixel",
                            "url": "http://ad4.liverail.com/?LR_PUBLISHER_ID=151025&LR_SCHEMA=vast2-vpaid&LR_TITLE=%%title%%&LR_VIDEO_ID=%%video-url%%&LR_DURATION=30&LR_AUTOPLAY=1&LR_MUTED=0&LR_VERTICALS=%%VERTICAL%%&LR_TAGS=%%tag%%&LR_URL=%%domain%%"
                        }
                    ]
                }
            }
        };
    </script>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published