Player Tag API

The Tag entity connects a channel to a template. The tag also enables setting custom placement for the player on any site utilizing CSS selectors and customizing the player loading script.

1. Login

To log in - the general login API is used. Example -


2. Logout

To log out - the general logout API is used. Example -


3. Tag entity API

3.1 Get Tags List

Retrieves a list of all Tags in the network.
Request URL:
https://manage.aniview.com/api/taggenerator/playertag?format=json&expand=null&filter={"$and":[{"status":{"$in":[1]}}]}

Request Method:
GET

Status Code:
200 OK

Filtering Parameters (Optional):

Parameter

Description

Values

Parameter

Description

Values

Type

Player type

outstream:1,instream:2

Status

Player status

1:active,2:archived


3.2. Create Tag

Request URL:
Request URL:

https://manage.aniview.com/api/taggenerator/playertag?format=json

Request Method:
POST

Main

Parameter

Type

Description

description

String

Player Tag description.

name

String

Player Tag Name.(Mandatory)

channel

String

Channel ID.

publisher

String

Publisher ID.

posDfp1x1

Boolean

Set true if there is a DFP pixel on the site.

posType

Boolean

Set true if you would like to set custom positioning using CSS selector.

type

0:ID, 1:Tag, 2:Class, 3:Selector

Select the CSS selector type.

value

String

Fill CSS Selector. Note that for ID and Class there is not need to use the # and . sings before the selector.

ref1

String

Use to pass one or more values for reporting and/or targeting purposes.
It needs to be built as a string (with an '&' sign connecting each value) and using Aniview's macros as placeholders.
For example: AV_APPNAME=appname_value&AV_CUSTOM1=custom1_value

template

String

Template ID.

Mobile

Parameter

Type

Description

_id

String

Channel ID

posDfp1x1

Boolean

Set true if there is a DFP pixel on the site.

posType

Boolean

Set true if you would like to set custom positioning using CSS selector.

type

0:ID, 1:Tag, 2:Class, 3:Selector

Select the CSS selector type.

value

String

Fill CSS Selector. Note that for ID and Class there is not need to use the # and . sings before the selector.

publisher

String

Publisher ID.

ref1

String

Use to pass one or more values for reporting and/or targeting purposes.
It needs to be built as a string (with an '&' sign connecting each value) and using Aniview's macros as placeholders.
For example: AV_APPNAME=appname_value&AV_CUSTOM1=custom1_value

template

String

Template ID.

A/B Testing

Parameter

Type

Description

abTest

String

Test title.

sp

Number between 1-100

Traffic allocation precentage.

channel

Int

Channel ID.

template

Int

Template ID.

posDfp1x1

Boolean

Select to add a DFP pixel for targeting as an override function.

A/B Testing: Test position (can be applied for each test)

Parameter

Type

Description

useDifferent

Boolean

Set true to use a different position for the specific test.

posType

Boolean

Set true if you would like to set custom positioning using CSS selector.

type

0:ID, 1:Tag, 2:Class, 3:Selector

Select the CSS selector type.

value

 

Fill CSS Selector. Note that for ID and Class there is not need to use the # and . sings before the selector.

A/B Testing Request Example Payload :

{ "staging": { "template": "template", "channel": "channel", "publisher": "publisher", "posDfp1x1": false, "overrideExtensions": { "isActive": false, "preloader": { "type": 0, "clickThrough": null } }, "ref1": null }, "configsArray": null, "configs": [ { "playerTag": { "template": { "name": "template_name", "id": null, "_id": { "$oid": "template_id" } }, "channel": { "name": "channel_name", "_id": { "$oid": "channel_id" } }, "publisher": null, "position": { "type": 2, "value": "class_here" } }, "abTest": "2", "sp": 100 } ], "type": 1, "usage": null, "isDeployed": true, "status": 1, "name": "tag_name", "publisherId": "publisherId" }

3.2.1 Create Outstream Tag

Outstream tag is an ad only player.

Minimal Request Example Payload :

{ "staging": { "template": "template_id", "channel": "channel_id", "publisher": "publisher_id", "posDfp1x1": false, "overrideExtensions": { "isActive": false, "preloader": { "type": 0, "clickThrough": null } }, "ref1": null }, "configsArray": null, "type": 1, "usage": null, "isDeployed": true, "status": 1, "name": "tag_name", "publisherId": "publisherId" }

Override Functions

The override function feature enables users to access the code that loads the Player. We recommend updating only the preRun and postStart functions. The preRun can be used to modify the config object and all other actions that should occur before the player loads. The postStart function should be applied whenever adjustments are made after the player loads. Please note that the postStart function loads with the player parameter represented as p.

Override function name

Type

Base code

create

4

 

var d1 = document.createElement("div"); d1.style.width = "100%"; d1.style.margin = "0 auto"; d1.style.maxWidth = "" + a.maxWidth + "px"; var d2 = document.createElement("div"); d2.id = "aniBox"; d2.style.height = "1px"; var d3 = document.createElement("div"); d3.id = "" + a.position; if (p === this.doc || p === this.doc.head) { p = this.doc.body; } if (n) { p.insertBefore(d1, n); } else { p.appendChild(d1); } a.refDiv = p; d1.appendChild(d2); d2.appendChild(d3); this.postCreate(d1);

findWin

1

 

getAttr

8

 

load

6

 

position

5

 

postCreate

2

Empty

postStart

7

Empty

preRun

10

Empty

retry

3

 

run

11

 

start

9

 

target

12

 

track

13

 

unique

0

 


3.2.2 Create Instream Tag

Instream tag is an ad and content player.

Minimal Request Example Payload :

Content

Parameter

Type

Description

breakingAdsMode

1:Slot, 2:Breaking Ads

Select from Ads Mode Type.

Define when ads are displayed.

breakingAds

Int

Time in seconds between waterfalls.

Only when set to breaking ads mode.

order

1:Sequence, 2:Random

Order Type.

randomFrom

Int

Define from which content number the player will start to randomize.

Only when order:2

tagContent

 

Boolean

Select for the player to only show content from the tag and not merge content from the tag and template.

firstPrerollSlotEnable

Boolean

Set true to configure the first preroll slot.

Only when set to breaking ads mode.

Content: Slots

Parameter

Type

Description

time

Int

Content time in seconds for an ad to start.

firstAdTimeout

Int

Limit in seconds to find the first ad.

Only when set to slot mode and firstPrerollSlot:true.

preloadAdTime

Int

Limit in seconds to find an ad.

maxAds

Int

Maximum number of ads player per slot.

nextAdTimeout

Int

Time in seconds for the next ad.

Tag with Slots Request Example Payload :

Tag with Breaking Ads Request Example Payload :


3.2.3 Generate Tag Script

Short Tag

Short Tag is a script element that can be applied directly on the publisher's site. If the tag created does not include a position the player will open in the location the element is implemented at.

Full Tag

Full tag is the full script that is loading the player to the page.

Request URL:
https://tg1.aniview.com/api/adserver/spt?AV_PUBLISHERID=${Publisher_ID}&AV_TAGID=${Tag_ID}&id=AV_${Tag_ID}

Request Method:
GET

Status Code:
200 OK

Parameter

Description

AV_PUBLISHERID

Publisher ID

AV_TAGID

Tag ID