Ad serverBlogDocumentation

Adsolutions – Tagman – Adsolutions

Adsolutions – Tagman

Common

The TAGMAN (tagmanager) library implements the ad-tags on a publishers website, and supplies a simple interface to regulate and work together with the ad-slots on the webpage. It’s additionally capable to function in a totally asynchronous means, so the ad-calls gained’t block the content movement of the writer.

Moreover, it prevents the global scope being polluted, by solely requiring a single international variable, which you’ll be able to set with an non-compulsory second international variable. Ads are rendered into an iframe, in order that they will even have their very own scope.

The Queue

The queue object is used, to predefine instructions while the JavaScript library is loaded. The queue is flushed as soon as the library is loaded, and when the DOM is prepared, and as soon as more when the document is loaded. The queue is a daily JavaScript object, any property inside is a separated queue, and have to be of an array sort. This enables for a number of various TAGMAN configurations. There are 3 properties reserved, which are TAG, CONFIG and EVENTDISPATCHER. The TAG property is a proxy for all outlined queues in order that it’s potential to replace the configuration or carry out interactions with all defined TAGMAN situations. The CONFIG property defines international configurations. By default, the global variable identify of the queue object is ASTAGQ, nevertheless it’s potential to use a special variable identify. To take action, the variable identify chosen have to be set within the variable $__ASTAGQNAME. For example, in case you select to call your queue variable MyASTAGQ, you need to set $__ASTAGQNAME = ‘MyASTAGQ’. In the event you choose to use the default variable identify this isn’t required.

To define the queue variable, use the next code:

This both creates a brand new queue object, with one queue named principal, or makes use of the already created one.

A queue command is a JavaScript perform which receives Three arguments, that are all elective. The arguments are in order, scope (which defines all courses which are exported from the library), queueObject (which holds a reference to the global queue object occasion), currentQueue (which holds a reference to the present queue being processed).
Sometimes you’d add a queued command with the next code:

A primary TAGMAN implementation might seem like:

Which specifies to make use of the ADTECH advert server with network id 72.34. And adds a single placement with id 4432106, which have to be rendered in a html aspect with id placement_001.

It’s necessary to have the community id setup appropriately. The network id may be found on the proper upper-corner of the I-Middle.

Public interface TAGMAN

.setAdserver(Implementation, Configuration)

Description: Initialises the advert server configuration
Arguments:

  • Implementation; String, the identify of the implementation
  • Configuration: Object, the configuration object, example: nw:’74.43′

The configuration object can have following properties;

  • nw: (string, required) the network id to use
  • autoAlias: (Boolean, elective) when true, it routinely set’s an alias to a placement, if no placement alias is specifically defined on the location. By default its value is false.

Returns: TAGMAN instance

.addModule(module)

Description: Adds a module to the current TAGMAN instance (presently there isn’t any help for international modules)
Arguments:

  • Module: Module instance, any javascript object which implements the public interface of a TAGMAN module.

Returns: TAGMAN occasion

.setSite(siteName)

Description: Defines the location identify, which for example can be used with the autoAlias function.
Arguments:

  • siteName: (string), the location identify

Returns: TAGMAN occasion

.setPage(pageName)

Description: Defines the pagename, which for example can be used with the autoAlias function.
Arguments:

  • pageName: (string), the page identify

Returns: TAGMAN instance

.setTag(key, worth)

Description: Units a key/value(s) pair, on which could be focused in the ad server, if the hot button is already set, it’s content’s shall be overwritten
Arguments:

  • key: String, the identify of the important thing. example: ‘bouwjaar’
  • worth: Primitive (string, number) or Array of primitives. example: 2009

Returns: TAGMAN occasion

.addTag(key, worth,[keep])

Description: Sets a key/worth(s) pair, on which might be focused in the ad server, if the secret’s already set, the value’s shall be added, if the maintain argument is just not provided, or is about to true.
Arguments:

  • key: String, the identify of the important thing. instance: ‘bouwjaar’
  • value: Primitive (string, number) or Array of primitives. example: 2009
  • hold: Boolean, whether or not to maintain the original values of the key

Returns: TAGMAN instance

.removeTag (key, [values])

Description: Removes a concentrating on key, or some values of a concentrating on key.
Arguments:

  • key: String, the identify of the key. example: ‘bouwjaar’
  • values: (non-compulsory ) Primitive (string, number) or Array of primitives. instance: 2009

Returns: TAGMAN occasion

.setKeywords(keywords)

Description: Sets key phrases overwriting the unique, on which may be targeted in the ad server
Arguments:

  • Keywords: String or Array: either a single keyword string, or an array of keywords. They array may be either an array of string, or an array of keyword objects; a keyword object has 2 properties, word and con, for instance phrase:’cola’, con:’|’. the con property may be either | or &, and permits to specify if the key phrase ought to be related with the previous key phrase in an OR or AND style. By default the connection is OR.

Returns: TAGMAN occasion

.addKeywords(key phrases,[keep])

Description: Provides keywords with out overwriting the original (until maintain = false), on which may be focused in the advert server
Arguments:

  • keywords: String or Array: either a single key phrase string, or an array of key phrases. The array could be either an array of string, or an array of keyword objects; a keyword object has 2 properties, word and con, for instance word:’cola’, con:’|’. the con property may be both | or &, and permits to specify if the keyword ought to be related with the earlier key phrase in an OR or AND style. by default the connection is OR.
  • hold: Boolean, whether or not to maintain the original keywords

Returns: TAGMAN occasion

.removeKeywords(keywords)

Description: Removes keywords
Arguments:

  • Keywords: String or Array: either a single keyword string, or an array of keywords. They array could be both an array of string, or an array of keyword objects; a keyword object has 2 properties, phrase and con, for example phrase:’cola’, con:’|’. the con property might be both | or &, and allows to specify if the keyword must be related with the previous key phrase in an OR or AND trend. by default the connection is OR.

Returns: TAGMAN instance

.disableBundleCall ()

Description: Disables bundled calling, which means each ad-slot will carry out its personal ad-call. This is the default conduct
Arguments:
Returns: TAGMAN instance

.enableBundleCall ()

Description: Allows bundled calling, which means all ad-slots can be requested in a single request. #NOTE: this is mutually unique with enableDirectCall
Arguments:
Returns: TAGMAN occasion

.enableDirectCall ([totalPlacementCount])

Description: Disables ready for all the ad-slot’s grow to be out there, which means as quickly as a call to addPlacement is carried out, a watcher is began to see if the html aspect is or turns into obtainable, as soon as obtainable the ad will immediately start rendering.
Arguments:

  • totalPlacementCount: (elective) Number, which specifies how a lot placements in complete will seem on the web page, this is essential for correct load detection, nevertheless it’s not required, however it may trigger for a too early absolutely loaded event, on account of timing points.

Returns: TAGMAN instance

.disableDirectCall ()

Description: The other of enableDirectCall, this is the default.
Arguments:
Returns: TAGMAN instance

.setMinimalVisibility (%)

Description: Sets the minimal visibility, an ad-slot should have before it begins rendering. By default, advertisements are all the time rendered, regardless their visibility.
Arguments:

  • %: Number, if it’s a constructive quantity the ad requires to be that proportion of visibility inside the viewport, when destructive, visibility checking is disabled.
    Returns: TAGMAN instance
.setRefreshPolicy (coverage)

Description: Units the interval occasions after which the ad-slots must be refreshed. The time starts counting after at the very least 1 ad-slot is loaded. By default there isn’t any refresh coverage
Arguments:

  • Policy: Quantity or Array of Numbers, the number are time in milliseconds to wait before a refresh is initiated. If a number is provided, the ad-slot will refresh infinitely on that interval. If it’s an array, each factor represents a time, and might be executed so as. If the aspect is constructive this is the time to attend, if it’s damaging the final time is used x occasions and then refresh stops, for example if the factor is -Three the final time shall be used for Three more occasions. If the aspect is 0 the last time shall be used to infinitely refresh.

Returns: TAGMAN instance

.setRenderDelay (delay)

Description: Sets a delay before rendering begins, this may be use-full for those who solely need to show advertisements to guests which are at the least x period of time on the webpage.
Arguments:

  • Delay: Number, of milliseconds to wait before rendering.

Returns: TAGMAN instance

.disableRenderDelay ()

Description: Disables the render delay. That is the default.
Arguments:
Returns: TAGMAN instance

.requiresFocus ()

Description: Requires the tab or browser window to have focus, earlier than rendering the advertisements.
Arguments:
Returns: TAGMAN occasion

.ignoreFocus ()

Description: Render the advertisements regardless if the browser tab/window has focus. That is the default.
Arguments:
Returns: TAGMAN instance

.setRenderOn (on)

Description: Specifies when the advertisements must be rendered, the default is when the DOM is prepared
Arguments:

  • on: String, which both could be;
    • domready: render the advertisements when the is dom ready
    • loaded: render the advertisements when all content material is loaded (when window onload is triggered)
  • scroll: render the advertisements when the consumer for the primary time scroll’s (for example use full for if advertisements are under the fold on content material articles)
  • none: don’t render the advertisements routinely

Returns: TAGMAN instance

.setCookieMode (mode)

Description: Units the cookie mode, the default is full
Arguments:

  • mode: String, which may both be;
  • full: use all cookie capabilities (eg. also cookie concentrating on)
  • regular: use normal cookie conduct
  • anonymous: disable using cookie’s

Returns: TAGMAN occasion

.enableFlashDetection ([majorKey], [minorKey])

Description: Detects the flash model and passes it as key/value to the adserver, so it can be targeted for campaigns that require flash.
Arguments:

  • majorKey: (optionally available) String, specifies the important thing to use in the ad-call (default: flash), when null the value won’t be send.
  • minorKey: (elective String, specifies the key to send the minor flash model (default: null, so by default solely the most important flash version is send)

Returns: TAGMAN occasion

.disableFlashDetection ()

Description: The other of enableFlashDetection, that is the default
Arguments:
Returns: TAGMAN occasion

.enableScreenDetection ([widthKey], [heightKey])

Description: Detects the display decision, and passes the outcome as key/value to the advert server, so campaigns may be targeted on the display resolution of the consumer. This can be use full for giant wealthy media advertisements, which don’t come to their full potential on small display resolutions, for instance once they don’t match on it.
#NOTE: The detection, makes use of the usual javascript display object, which signifies that it passes the resolutions of the first display of the consumer, and the actual doc or window dimensions will not be taken under consideration.
Arguments:

  • widthKey: (optionally available) String, the important thing identify to use within the ad-call (default: screenwidth)
  • heightKey: (optionally available) String, the key identify to use within the ad-call (default: screenheight)

Returns: TAGMAN occasion

.disableScreenDetection ()

Description: the other of enableScreenDetection, that is the default
Arguments:
Returns: TAGMAN occasion

.doPassLoadCount ([loadKey])

Description: Passes the occasions the TAGMAN has loaded ad’s as key/worth to the adserver. this can be use full for instance along side the refresh policy, so you possibly can target premium campaigns on the first-call and remnant campaigns on refreshes.
Arguments:

  • loadKey: (elective) String, the key identify to make use of within the ad-call (default: loadcount)

Returns: TAGMAN instance

.dontPassLoadCount ()

Description: The other of doPassLoadCount, that is the default
Arguments:
Returns: TAGMAN occasion

.doPassPlacementCount ([placementCountKey])

Description: Passes the entire quantity of placements as key/value to the adserver.
Arguments:

  • placementCountKey: (optionally available) String, the important thing identify to make use of in the ad-call (default: plccount)

Returns: TAGMAN occasion

.dontPassPlacementCount ()

Description: The other of doPassPlacementCount, that is the default
Arguments:
Returns: TAGMAN instance

.enableDefaultDetection ()

Description: allows globally default detection for all placements, that is the default.
Arguments:
Returns: TAGMAN instance

.disableDefaultDetection ()

Description: disables globally default detection for all placements (reverse of enabableDefaultDection)
Arguments:
Returns: TAGMAN instance

.addEventListener (listenerObj)

Description: adds a listener object to the tagmanager occasion, at present there are 2 events obtainable;

  • onDefault; when a placement receives a default adserver response, the handler will obtain 2 arguments, the first being tagmanager instance, the second the location object which acquired the default adserver response.
  • onPlacementLoaded; when a placement is loaded, the handler will receive 2 arguments, the primary being the tagmanager occasion, the second the location which is loaded.

Arguments:

  • listenerObj: an object defining the handlers, example:

onDefault:perform(tagman, placement)
//do something

Returns: TAGMAN instance

.resetTags ()

Description: Clears all key/values outlined
Arguments:
Returns: TAGMAN instance

.resetKeywords ()

Description: Clears all keywords outlined
Arguments:
Returns: TAGMAN instance

.resetTargeting ()

Description: Clears all potential concentrating on parameters defined
Arguments:
Returns: TAGMAN instance

.addPlacement(sizes, htmlId, [configuration])

Arguments:

  • sizes: Array or Object, Array of measurement objects, in any other case an single measurement object. instance: id:123456,identify: ‘468×60’,includeSizes:[‘1×1′,’468×60’]a measurement object can include following properties;
    • id: (quantity, string) the location id (or fallback placement id)
    • identify: (string) the identify of the location, this shall be used together with the autoAlias function and represents the postfix of the alias string
    • alias: (string) the alias of the location, this overrides the autoAlias function for this single placement
    • includeSizes: (string, array or object) a measurement definition of sizes which are allowed to display on this placement
    • excludeSizes: (string, array or object) a measurement definition of sizes which are not allowed to show on this placement
    • tags: (object) defines further key/values which only apply to this placement (this presently isn’t obtainable when bundled mode is enabled). Instance: position:’pos1′,prijs:1500,additional:[‘val1′,’val2’]
    • key phrases: (array, string) defines further key phrases which only apply to this placement (this presently isn’t obtainable when bundled mode is enabled). The value is identical is the setKeywords argument. Instance: [‘kw1′,’kw2’]
    • htmlId: string or DOMNode, when it’s a string, the string must provide a legitimate html id, which sooner or later must seem in the DOM, in this node the commercial can be rendered
    • configuration: Object, an elective configuration object. The configuration object can have following properties;
    • initialWidth: (quantity) the initial width (in px) the iframe ought to occupy (default: 0)
    • initialHeight: (number) the preliminary peak (in px) the iframe ought to occupy (default: 0)
    • virtualWidth: (quantity) the digital width (in px) the location has, this worth is used with visibility detection, when there isn’t a preliminary width, or precise width recognized (default: 0)
    • virtualHeight: (number) the digital peak (in px) the location has, this worth is used with visibility detection, when there isn’t a initial peak, or precise peak recognized (default: zero)
    • maxWidth: (quantity) the maximum width (in px) the iframe can occupy, which might imply if a bigger artistic is served, will probably be partly hidden, but the website format is protected (default: disabled)
    • maxHeight: (number) the maximum peak (in px) the iframe can occupy, which might imply if a bigger artistic is served, it is going to be partly hidden, but the website format is protected (default: disabled)
    • minWidth: (quantity) the minimum width (in px) the iframe will occupy, which would mean if a smaller artistic is served, the location will occupy a larger area, however the website format is protected (default: disabled)
    • minHeight: (quantity) the minimal peak (in px) the iframe will occupy, which might mean if a smaller artistic is served, the location will occupy a bigger area, however the website format is protected (default: disabled)
    • visibility: (quantity) overrides the worldwide visibility detection value, use -1 to disable visibility detection.
    • initialSizeMode: (string) learn the initial dimensions from the defined placement placeholder aspect or through the use of the includeSize definition. By default it’s disabled (worth: none), to allow set it to: auto, to learn it from the location placeholder component, and set it to: measurement to read it from the dimensions definition
    • reloadSizeMode: (string) how the location ought to be sizes when a reload happens, by default the location dimensions shall be reset to 0x0, to stop this set it to value: depart, which can hold the location to its current dimensions, until the brand new advert is loaded, and the new dimensions are recognized.
    • dontManageContainer: (Boolean) whether or not or not the location placeholder must be modified with the size of the ad. By default: true, which suggests the location placeholder won’t be up to date with the size of the loaded ad, set the true, should you don’t want that the width and peak are updated on the location placeholder.
    • allowForceSize: (Boolean) permit advertisements to pressure the size of the iframe (by passing the autodetection), this solely applies once they use the general public interface, properties aren’t monitored ($ASTAG_PlacementObject.forceSize(width,peak);). Default this is allowed
    • restrainForcedSize: (Boolean) whether or not the min/max dimensions must be validated when a banner forces a measurement, default: true.
    • defaultDetection: (Boolean) whether or not the location ought to analyze the response if the adserver responded with a default advert. By default it’s enabled, disabling it may need a small efficiency improvement.

Returns: TAGMAN occasion

.render ()

Description: Initiates the rendering process. Usually this doesn’t must be referred to as, as it’s referred to as routinely based mostly on the renderOn coverage (see setRenderOn). It’s attainable to make use of this if you’d like the advertisements to load ahead of one of many renderOn event happens. It’s advised to setRenderOn(‘none’) in case you plan to call render manually. Additionally word, by no means name render at the side of enableDirectCall function is enabled.
Arguments:
Returns: void

.reload ()

Description: Reloads all the ad-slots
Arguments:
Returns: Boolean, true when reload is instantly initiated, false when it’s already loading, and it’s queued till load completes or when the reload is ignored, as there are not any modifications while a load was already in progress.

Debugger

To point out the debug panel, place ASTAG_DEBUG someplace within the url, if you want to present the debugger, if the web page is already loaded, add the ASTAG_DEBUG string as has tag, thus #ASTAG_DEBUG
Example1: http://cdn.adsolutions.nl/tagman/test1.html?ASTAG_DEBUG
Example2: http://cdn.adsolutions.nl/tagman/test1.html#ASTAG_DEBUG

Examples

The essential, utilizing a multiad call, to show all ad’s, and load polite;
http://cdn.adsolutions.nl/tagman/test1.html

Using a multiad name, to display all ad’s, and cargo well mannered, however solely run the ad-code, if the ad-slot is visible(for more than 50%) (scroll right down to see);
http://cdn.adsolutions.nl/tagman/test2.html

Using a multiad name, to display all ad’s, and cargo well mannered, and refresh the advert’s in accordance a schedule, first 3sec, then 5, then 9, and repeat it Three occasions extra ;
http://cdn.adsolutions.nl/tagman/test3.html

Utilizing a multiad call, to show all ad’s, and load well mannered, and refresh the advert’s according a schedule, first 3sec, then 5, then 9, and repeat it 3 occasions extra, however only run the ad-code when the adslot is visible (for more than 50%) ;
http://cdn.adsolutions.nl/tagman/test4.html

Utilizing regular addyn (javascript tags), and cargo well mannered;
http://cdn.adsolutions.nl/tagman/test5.html

Utilizing common addyn (javascript tags), and cargo polite, but only carry out the ad-call when the ad-slot is visible (for more than 50%);
http://cdn.adsolutions.nl/tagman/test6.html

Utilizing common addyn (javascript tags), and load well mannered, however solely perform the ad-call when the ad-slot is seen (for more than 50%), but again with a refresh schema;
http://cdn.adsolutions.nl/tagman/test7.html

Using regular addyn (javascript tags), however not load well mannered (thus as quickly as the ad-slot becomes obtainable (and is visible) the decision is completed), but only perform the ad-call when the ad-slot is seen (for greater than 50%), but again with a refresh schema;
http://cdn.adsolutions.nl/tagman/test8.html

Similar as 8, solely adding an extra placement, which uses the multiad ad-call to show a table;
http://cdn.adsolutions.nl/tagman/test9.html

Similar as 8, only adding an placement alias;
http://cdn.adsolutions.nl/tagman/test10.html

Adds Revenue Science module, allows; flash and display detection, and send the loaded occasions and placement counts to the adserver, and uses anonymous ad-call’s. And solely masses the advertisements when the browser tab has focus
http://cdn.adsolutions.nl/tagman/test11.html

Similar as 11, however instantly begins rendering, which means, as quickly as all html parts outlined can be found the ad-call is performed.
http://cdn.adsolutions.nl/tagman/test12.html

Exhibits a pattern implementation of the autoAlias function;
http://cdn.adsolutions.nl/tagman/test13.html

Related posts
AwardsBlogCannes LionsFestivalsjuriesjurors

Cannes Lions announces final jury members for 2019

Ad NetworksAdWordsAmazon DSParbitrageBlogFacebook Audience NetworkFeaturedgoogle display networkPlatformsprogrammatic advertising

The Walled Gardens Are Eating Open Programmatic – Here’s How They Do It

accessibilityBlogcsshtmljavascriptprintWebWHCM

Periodic Table of the Elements

Ad NetworksAdultAlternativesBlogNon-AdultURL Shortener

LinkShrink Alternatives: 20 Best Alternatives Of LinkShrink In 2019