Skip to content
Vladas Drejeris edited this page Jun 4, 2021 · 4 revisions

Ad Tags

An ad tag is a piece of HTML/JavaScript code, XML, or URL which could be inserted into the ad view directly to load an ad creative.

To set an HTML/JavaScript ad tag you can use 'adTag' property on an ad view. You must set a string with banner source code to this property. For example:

Swift

adInline.adTag = "<body>Your html banner</body>"
Objective-C
adInline.adTag = @"<body>Your html banner</body>";

In order to display video ads, it is possible to set VAST XML document as ad tag. For example:

Swift

adInline.adTag = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><VAST> Your VAST XML document </VAST>"
Objective-C
adInline.adTag = @"<?xml version=\"1.0\" encoding=\"UTF-8\"?><VAST> Your VAST XML document </VAST>";

An URL to VAST XML is supported as well.

Swift

adInline.adTag = URL(string: "http://yourdomain.com/vast.xml")
Objective-C
adInline.adTag = [NSURL URLWithString:@"http://yourdomain.com/vast.xml"];

Please note, that Ad overlay doesn't support video ad tags.