{"_id":"58119608d2cf5b0f00a58060","user":"569d8ad30306a10d00ce9a1f","version":{"_id":"5429beef1163360800ed31fd","__v":21,"project":"5429beef1163360800ed31fa","createdAt":"2014-09-29T20:19:59.904Z","releaseDate":"2014-09-29T20:19:59.904Z","categories":["5429beef1163360800ed31fe","55e74e1f5d36b32b002563fa","55e7500a73169617001f2e86","55e76b8196131b2f00bf4b72","55e89569cdbb8a350096df9c","55f8935eb089b71700a8364e","55f8a67d3bb4bb0d0022d093","55f9dbefc7ef770d00d9bf6d","5601c21a22ecf60d002b27b3","5601c21ff12aee0d001bb06e","5601c2256c7b610d00280db5","5601c22c22ecf60d002b27b4","5603738d0c78b00d0039af47","5626f70bfcbbc621004ebf52","566f7a1ae144ab0d00e9732f","566f85ca7820960d00c3b93d","56708ce43a32d20d00c45cbf","56708d436995210d003aad8e","5736471abe10a9200030732c","57a82c7aff9bd30e00a6f1c1","591b8500e3992319007190f4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"55e76b8196131b2f00bf4b72","pages":["55e8b2c13fef5017000dbd9a","55e8b365f0f1850d00d24a5b","55f88ebd5840d119004346bf","55f8ab55c449610d002daf87","5603759a8d58900d0051e9ee","560375cd90ee490d004403da","5633b5ebc49a7c19001fd091","567353ae47f7010d005bfdc9"],"project":"5429beef1163360800ed31fa","__v":8,"version":"5429beef1163360800ed31fd","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-09-02T21:34:57.232Z","from_sync":false,"order":2,"slug":"apis","title":"Integrating with APIs"},"project":"5429beef1163360800ed31fa","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-27T05:52:08.956Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":10,"body":"This document will provide you a overview of the Video Ad integration methods via AdsNative. This document is mostly intended to developers / product team.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Types Of Creatives\"\n}\n[/block]\nPublishers usually work with three different video formats/creative types for their video ads\n* Direct video asset\n* 3rd party VAST tag\n* 3rd party VPAID  tag\n\nAdsNative supports all 3 formats. VPAID creatives in general are not cross platform compatible and they only work on Desktop platform within browsers.\n\nPublishers can integrate Video ads in two different ways\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Using AdsNative iOS/Android/JavaScript SDK\"\n}\n[/block]\n* Native iOS and Android player will be used to render the video within publisher Native App.\n* HTML5 Video player will be used to render the video on Desktop and Mobile web.\n* AdsNative SDK's handle the ad request, response, firing impression, click and quartile completion trackers. Publisher just has to integrate the SDK into their application\n\nDocumentation for each can be found here [**iOS**](https://dev.adsnative.com/docs/ios-sdk), **[Android](https://dev.adsnative.com/docs/android-sdk)** and **[JavaScript](https://dev.adsnative.com/docs/render-js-usage)** \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Using AdsNative RESTful API\"\n}\n[/block]\n**Using AdsNative Video Player**\n* Publishers can make use of pre-baked Embed URL (iFrame video) as part of the API response and render the url as source of an iframe (web) or load in a webview (native apps)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"embedUrl: \\\"http://api.adsnative.com/v1/creative.html?crid=SH9CGOFX&sid=559f3bf6d00c4869ab7e1b7ca321a484_914c2a1b\\\"\",\n      \"language\": \"json\",\n      \"name\": \"Sample Embed URL in API Response\"\n    }\n  ]\n}\n[/block]\n**Using Publisher own Video Player**\n* Publishers can integrate the Ad into their own Video player for native app and web properties to render the video ad.\n* Publisher is responsible for\n  * Consuming the API response\n  * Feeding the Video ad to their custom video player\n  * Firing impression, click, quartile completion and other standard video trackers\n* It would be ideal to give publishers an option to choose the output format in which they want to receive the standardized response for video. Those two options supported by AdsNative are  \n  * JSON response\n  * VAST XML response\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"API Request / Response\"\n}\n[/block]\nPublisher makes a [**REST API call**](https://dev.adsnative.com/docs/ads-api-web) as usual. Within the API response, \n\n* If the video creative is a **\"Direct video asset\"** that was uploaded by publisher himself or by his advertisers into AdsNative UI, then API response will have a **JSON \"video\" object** which carries the media details, a list of all the tracking URLs and also a standard dynamically generated VAST URL which has the complete video response in XML format. \n\n1. Using JSON \"video\" object (returned in API only for Direct video assets), publisher can stitch the video player and content on server side itself and return the stitched web page to the client. \n\n2. Using VAST tag URL, publisher should return the URL to client side web page / native app which will be consumed by the publisher own VAST compliant video player\n\n**Example** API request : http://api.adsnative.com/v1/ad.json?zid=ping&cid=3385&preview=1\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"**\\\"vastUrl\\\"** attribute and the **\\\"video\\\" JSON object**\",\n  \"title\": \"Look for\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    status: \\\"OK\\\",\\n    count: 1,\\n    ad: {\\n        vastUrl: \\\"http://api.adsnative.com/v1/vast.xml?crid=SH9CGOFX&sid=559f3bf6d00c4869ab7e1b7ca321a484_914c2a1b\\\",\\n        promotedByUrl: \\\"\\\",\\n        trackingTags: \\\"<img src=\\\"\\n        http: //bevo-us-east-1.adsnative.com/im.gif?data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk4NWEz\\\" BORDER=0 WIDTH=1 HEIGHT=1> \\\",\\n            ctaTitle: \\\"\\\",\\n        summary: \\\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur maximus, risus sit amet volutpat maximus, quam leo vehicula ipsum, quis hendrerit ante odio at velit.\\\",\\n        videoExperience: \\\"autoplay_inview\\\",\\n        promotedBy: \\\"AdsNative\\\",\\n        video: {\\n            media: [{\\n                url: \\\"//cdn.adsnative.com/media/nw-13/c1678282-e428-4f57-8e7c-292e26b1b614.mp4\\\",\\n                width: \\\"1280px\\\",\\n                type: \\\"media/mp4\\\",\\n                height: \\\"720px\\\"\\n            }],\\n            trackingUrls: {\\n                impression: [\\n                    \\\"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=impression&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQw\\\"\\n                ],\\n                pause: [],\\n                complete: [\\n                    \\\"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_complete&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1O\\\"\\n                ],\\n                clickThrough: [\\n                    \\\"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=click&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkM\\\"\\n                ],\\n                unmute: [],\\n                fullscreen: [],\\n                resume: [],\\n                mute: [],\\n                start: [\\n                    \\\"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=view&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMm\\\"\\n                ],\\n                duration: {\\n                    percentage: {\\n                        25: [\\n                            \\\"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_25&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQ\\\"\\n                        ],\\n                        50: [\\n                            \\\"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_50&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQ\\\"\\n                        ],\\n                        75: [\\n                            \\\"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_75&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQ\\\"\\n                        ]\\n                    }\\n                }\\n            },\\n            experience: \\\"autoplay_inview\\\"\\n        },\\n        target: \\\"_blank\\\",\\n        title: \\\"AdsNative Native Player Sample Video Ad\\\",\\n        url: \\\"http://bevo-us-east-1.adsnative.com/ck?url=http%3A%2F%2Fadsnative.com&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1M\\\",\\n        trackingUrls: {\\n            impressions: [\\n                \\\"http://bevo-us-east-1.adsnative.com/im.gif?data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk4NWEz\\\"\\n            ],\\n            viewables: [\\n                \\\"http://bevo-us-east-1.adsnative.com/vi.gif?data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk4NWEz\\\"\\n            ],\\n            clicks: [\\n                \\\"http://bevo-us-east-1.adsnative.com/ck?nr=1&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk\\\"\\n            ],\\n            actions: {\\n                share: [\\n                    \\\"http://bevo-us-east-1.adsnative.com/ca.gif?action_name=action&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZ\\\"\\n                ]\\n            }\\n        },\\n        ctaUrl: null,\\n        viewableTags: \\\"<img src=\\\"\\n        http: //bevo-us-east-1.adsnative.com/vi.gif?data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk4NWEz\\\" BORDER=0 WIDTH=1 HEIGHT=1> \\\",\\n            imageSrc: \\\"http://cdn.adsnative.com/media/3385/32384d44-5a0a-476a-b984-c2f931e3817d.jpg\\\",\\n        promotedByTag: \\\"Promoted by\\\",\\n        backgroundColor: \\\"#FFFFFF\\\",\\n        sid: \\\"559f3bf6d00c4869ab7e1b7ca321a484_914c2a1b\\\",\\n        brandImageUrl: \\\"\\\",\\n        embedUrl: \\\"http://api.adsnative.com/v1/creative.html?crid=SH9CGOFX&sid=559f3bf6d00c4869ab7e1b7ca321a484_914c2a1b\\\",\\n        type: \\\"video\\\"\\n    },\\n    cid: \\\"Q3YAPZTR\\\",\\n    crid: \\\"SH9CGOFX\\\",\\n    zid: \\\"ping\\\",\\n    sid: \\\"559f3bf6d00c4869ab7e1b7ca321a484\\\",\\n    uuid: \\\"cca6ce37-e8fc-49c5-b528-050f5a114378\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n* If the video creative is a **\"3rd party VAST tag\"** (Inline only. Wrapper VAST tags are not supported at this point) that was setup by publisher himself or by his advertisers into AdsNative UI, then API response will have a a standard dynamically generated **VAST URL** which has the complete video response in XML format. See Below,\n\n**Example** API request : http://api.adsnative.com/v1/ad.json?zid=ping&cid=13963&preview=1\n\n  \n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Look for\",\n  \"body\": \"the **\\\"vastUrl\\\"** (Wrapper VAST)\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    status: \\\"OK\\\",\\n    count: 1,\\n    ad: {\\n        vastUrl: \\\"http://api.adsnative.com/v1/vast.xml?crid=I2YQY5UA&sid=a4e02a370f14435981759943ba34b4f1_9828bfaa\\\",\\n        promotedByUrl: \\\"\\\",\\n        trackingTags: \\\"<img src=\\\"\\n        http: //bevo-us-east-1.adsnative.com/im.gif?data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk5MjM1\\\" BORDER=0 WIDTH=1 HEIGHT=1> \\\",\\n            ctaTitle: \\\"\\\",\\n        summary: \\\"\\\",\\n        videoExperience: \\\"autoplay_inview\\\",\\n        promotedBy: \\\"OmniVirt\\\",\\n        target: \\\"_blank\\\",\\n        title: \\\"OmniVirt 360 Video via AdsNative\\\",\\n        url: \\\"http://bevo-us-east-1.adsnative.com/ck?url=https%3A%2F%2Fwww.omnivirt.com%2F&data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0Mz\\\",\\n        trackingUrls: {\\n            impressions: [\\n                \\\"http://bevo-us-east-1.adsnative.com/im.gif?data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk5MjM1\\\"\\n            ],\\n            viewables: [\\n                \\\"http://bevo-us-east-1.adsnative.com/vi.gif?data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk5MjM1\\\"\\n            ],\\n            clicks: [\\n                \\\"http://bevo-us-east-1.adsnative.com/ck?nr=1&data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk\\\"\\n            ],\\n            actions: {\\n                action: [\\n                    \\\"http://bevo-us-east-1.adsnative.com/ca.gif?action_name=action&data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3N\\\"\\n                ]\\n            }\\n        },\\n        ctaUrl: null,\\n        viewableTags: \\\"<img src=\\\"\\n        http: //bevo-us-east-1.adsnative.com/vi.gif?data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk5MjM1\\\" BORDER=0 WIDTH=1 HEIGHT=1> \\\",\\n            imageSrc: \\\"http://cdn.adsnative.com/media/13963/2eebfcac-2daf-4701-b95f-983bf55bb8c4.jpg\\\",\\n        promotedByTag: \\\"Promoted by\\\",\\n        backgroundColor: \\\"#FFFFFF\\\",\\n        sid: \\\"a4e02a370f14435981759943ba34b4f1_9828bfaa\\\",\\n        brandImageUrl: \\\"\\\",\\n        embedUrl: \\\"http://api.adsnative.com/v1/creative.html?crid=I2YQY5UA&sid=a4e02a370f14435981759943ba34b4f1_9828bfaa\\\",\\n        type: \\\"video\\\"\\n    },\\n    cid: \\\"QFD8YE74\\\",\\n    crid: \\\"I2YQY5UA\\\",\\n    zid: \\\"ping\\\",\\n    sid: \\\"a4e02a370f14435981759943ba34b4f1\\\",\\n    uuid: \\\"cca6ce37-e8fc-49c5-b528-050f5a114378\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nVAST url response will be <wrapper> response which contains the 3rd party VAST tag redirect along with AdsNative tracking URLs as shown below\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<VAST\\n    xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:noNamespaceSchemaLocation=\\\"vast.xsd\\\" version=\\\"3.0\\\">\\n    <Ad>\\n        <Wrapper>\\n            <AdSystem>AdsNative</AdSystem>\\n            <VASTAdTagURI>\\n                <![CDATA[ http:://upload.omnivirt.com/vpaid/24.xml ]]>\\n            </VASTAdTagURI>\\n            <Impression>\\n                <![CDATA[\\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=impression&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2YjlmO\\n]]>\\n            </Impression>\\n            <Creatives>\\n                <Creative>\\n                    <Linear>\\n                        <!--  <Duration></Duration>  -->\\n                        <TrackingEvents>\\n                            <Tracking event=\\\"start\\\">\\n                                <![CDATA[\\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=view&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2YjlmOGMzOTM\\n]]>\\n                            </Tracking>\\n                            <Tracking event=\\\"firstQuartile\\\">\\n                                <![CDATA[\\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_25&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2Yjlm\\n]]>\\n                            </Tracking>\\n                            <Tracking event=\\\"midpoint\\\">\\n                                <![CDATA[\\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_50&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2Yjlm\\n]]>\\n                            </Tracking>\\n                            <Tracking event=\\\"thirdQuartile\\\">\\n                                <![CDATA[\\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_75&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2Yjlm\\n]]>\\n                            </Tracking>\\n                            <Tracking event=\\\"complete\\\">\\n                                <![CDATA[\\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_complete&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2\\n]]>\\n                            </Tracking>\\n                        </TrackingEvents>\\n                        <VideoClicks>\\n                            <ClickTracking id=\\\"\\\">\\n                                <![CDATA[\\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=click&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2YjlmOGMzOT\\n]]>\\n                            </ClickTracking>\\n                        </VideoClicks>\\n                    </Linear>\\n                </Creative>\\n            </Creatives>\\n        </Wrapper>\\n    </Ad>\\n</VAST>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"video-ad-integration","type":"basic","title":"Video Ad Integration"}

Video Ad Integration


This document will provide you a overview of the Video Ad integration methods via AdsNative. This document is mostly intended to developers / product team. [block:api-header] { "type": "basic", "title": "Types Of Creatives" } [/block] Publishers usually work with three different video formats/creative types for their video ads * Direct video asset * 3rd party VAST tag * 3rd party VPAID tag AdsNative supports all 3 formats. VPAID creatives in general are not cross platform compatible and they only work on Desktop platform within browsers. Publishers can integrate Video ads in two different ways [block:api-header] { "type": "basic", "title": "1. Using AdsNative iOS/Android/JavaScript SDK" } [/block] * Native iOS and Android player will be used to render the video within publisher Native App. * HTML5 Video player will be used to render the video on Desktop and Mobile web. * AdsNative SDK's handle the ad request, response, firing impression, click and quartile completion trackers. Publisher just has to integrate the SDK into their application Documentation for each can be found here [**iOS**](https://dev.adsnative.com/docs/ios-sdk), **[Android](https://dev.adsnative.com/docs/android-sdk)** and **[JavaScript](https://dev.adsnative.com/docs/render-js-usage)** [block:api-header] { "type": "basic", "title": "2. Using AdsNative RESTful API" } [/block] **Using AdsNative Video Player** * Publishers can make use of pre-baked Embed URL (iFrame video) as part of the API response and render the url as source of an iframe (web) or load in a webview (native apps) [block:code] { "codes": [ { "code": "embedUrl: \"http://api.adsnative.com/v1/creative.html?crid=SH9CGOFX&sid=559f3bf6d00c4869ab7e1b7ca321a484_914c2a1b\"", "language": "json", "name": "Sample Embed URL in API Response" } ] } [/block] **Using Publisher own Video Player** * Publishers can integrate the Ad into their own Video player for native app and web properties to render the video ad. * Publisher is responsible for * Consuming the API response * Feeding the Video ad to their custom video player * Firing impression, click, quartile completion and other standard video trackers * It would be ideal to give publishers an option to choose the output format in which they want to receive the standardized response for video. Those two options supported by AdsNative are * JSON response * VAST XML response [block:api-header] { "type": "basic", "title": "API Request / Response" } [/block] Publisher makes a [**REST API call**](https://dev.adsnative.com/docs/ads-api-web) as usual. Within the API response, * If the video creative is a **"Direct video asset"** that was uploaded by publisher himself or by his advertisers into AdsNative UI, then API response will have a **JSON "video" object** which carries the media details, a list of all the tracking URLs and also a standard dynamically generated VAST URL which has the complete video response in XML format. 1. Using JSON "video" object (returned in API only for Direct video assets), publisher can stitch the video player and content on server side itself and return the stitched web page to the client. 2. Using VAST tag URL, publisher should return the URL to client side web page / native app which will be consumed by the publisher own VAST compliant video player **Example** API request : http://api.adsnative.com/v1/ad.json?zid=ping&cid=3385&preview=1 [block:callout] { "type": "info", "body": "**\"vastUrl\"** attribute and the **\"video\" JSON object**", "title": "Look for" } [/block] [block:code] { "codes": [ { "code": "{\n status: \"OK\",\n count: 1,\n ad: {\n vastUrl: \"http://api.adsnative.com/v1/vast.xml?crid=SH9CGOFX&sid=559f3bf6d00c4869ab7e1b7ca321a484_914c2a1b\",\n promotedByUrl: \"\",\n trackingTags: \"<img src=\"\n http: //bevo-us-east-1.adsnative.com/im.gif?data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk4NWEz\" BORDER=0 WIDTH=1 HEIGHT=1> \",\n ctaTitle: \"\",\n summary: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur maximus, risus sit amet volutpat maximus, quam leo vehicula ipsum, quis hendrerit ante odio at velit.\",\n videoExperience: \"autoplay_inview\",\n promotedBy: \"AdsNative\",\n video: {\n media: [{\n url: \"//cdn.adsnative.com/media/nw-13/c1678282-e428-4f57-8e7c-292e26b1b614.mp4\",\n width: \"1280px\",\n type: \"media/mp4\",\n height: \"720px\"\n }],\n trackingUrls: {\n impression: [\n \"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=impression&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQw\"\n ],\n pause: [],\n complete: [\n \"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_complete&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1O\"\n ],\n clickThrough: [\n \"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=click&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkM\"\n ],\n unmute: [],\n fullscreen: [],\n resume: [],\n mute: [],\n start: [\n \"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=view&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMm\"\n ],\n duration: {\n percentage: {\n 25: [\n \"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_25&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQ\"\n ],\n 50: [\n \"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_50&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQ\"\n ],\n 75: [\n \"http://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_75&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQ\"\n ]\n }\n }\n },\n experience: \"autoplay_inview\"\n },\n target: \"_blank\",\n title: \"AdsNative Native Player Sample Video Ad\",\n url: \"http://bevo-us-east-1.adsnative.com/ck?url=http%3A%2F%2Fadsnative.com&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1M\",\n trackingUrls: {\n impressions: [\n \"http://bevo-us-east-1.adsnative.com/im.gif?data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk4NWEz\"\n ],\n viewables: [\n \"http://bevo-us-east-1.adsnative.com/vi.gif?data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk4NWEz\"\n ],\n clicks: [\n \"http://bevo-us-east-1.adsnative.com/ck?nr=1&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk\"\n ],\n actions: {\n share: [\n \"http://bevo-us-east-1.adsnative.com/ca.gif?action_name=action&data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZ\"\n ]\n }\n },\n ctaUrl: null,\n viewableTags: \"<img src=\"\n http: //bevo-us-east-1.adsnative.com/vi.gif?data=MDZjNTEwZjczMmYxNzkzYzg1M2M1YzY4YTcwNTM1ZmY4MWFiNmNlZGRhZTRlN2Y3MjAzYThlMDE1NDg2MWY5ZTAyZGQ5YmQ1MDM2NWMyMTY3NWZiYzZmYTY0ODE1Mzc1OWIwYjQwZDFkMmY3ZjQ0YTk4NWEz\" BORDER=0 WIDTH=1 HEIGHT=1> \",\n imageSrc: \"http://cdn.adsnative.com/media/3385/32384d44-5a0a-476a-b984-c2f931e3817d.jpg\",\n promotedByTag: \"Promoted by\",\n backgroundColor: \"#FFFFFF\",\n sid: \"559f3bf6d00c4869ab7e1b7ca321a484_914c2a1b\",\n brandImageUrl: \"\",\n embedUrl: \"http://api.adsnative.com/v1/creative.html?crid=SH9CGOFX&sid=559f3bf6d00c4869ab7e1b7ca321a484_914c2a1b\",\n type: \"video\"\n },\n cid: \"Q3YAPZTR\",\n crid: \"SH9CGOFX\",\n zid: \"ping\",\n sid: \"559f3bf6d00c4869ab7e1b7ca321a484\",\n uuid: \"cca6ce37-e8fc-49c5-b528-050f5a114378\"\n}", "language": "json" } ] } [/block] * If the video creative is a **"3rd party VAST tag"** (Inline only. Wrapper VAST tags are not supported at this point) that was setup by publisher himself or by his advertisers into AdsNative UI, then API response will have a a standard dynamically generated **VAST URL** which has the complete video response in XML format. See Below, **Example** API request : http://api.adsnative.com/v1/ad.json?zid=ping&cid=13963&preview=1 [block:callout] { "type": "info", "title": "Look for", "body": "the **\"vastUrl\"** (Wrapper VAST)" } [/block] [block:code] { "codes": [ { "code": "{\n status: \"OK\",\n count: 1,\n ad: {\n vastUrl: \"http://api.adsnative.com/v1/vast.xml?crid=I2YQY5UA&sid=a4e02a370f14435981759943ba34b4f1_9828bfaa\",\n promotedByUrl: \"\",\n trackingTags: \"<img src=\"\n http: //bevo-us-east-1.adsnative.com/im.gif?data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk5MjM1\" BORDER=0 WIDTH=1 HEIGHT=1> \",\n ctaTitle: \"\",\n summary: \"\",\n videoExperience: \"autoplay_inview\",\n promotedBy: \"OmniVirt\",\n target: \"_blank\",\n title: \"OmniVirt 360 Video via AdsNative\",\n url: \"http://bevo-us-east-1.adsnative.com/ck?url=https%3A%2F%2Fwww.omnivirt.com%2F&data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0Mz\",\n trackingUrls: {\n impressions: [\n \"http://bevo-us-east-1.adsnative.com/im.gif?data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk5MjM1\"\n ],\n viewables: [\n \"http://bevo-us-east-1.adsnative.com/vi.gif?data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk5MjM1\"\n ],\n clicks: [\n \"http://bevo-us-east-1.adsnative.com/ck?nr=1&data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk\"\n ],\n actions: {\n action: [\n \"http://bevo-us-east-1.adsnative.com/ca.gif?action_name=action&data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3N\"\n ]\n }\n },\n ctaUrl: null,\n viewableTags: \"<img src=\"\n http: //bevo-us-east-1.adsnative.com/vi.gif?data=YzNkNTMzODIzYjg3ZDcyODc3YzMwMTBhMGYyODRkMzY2ZTBkOGVlYzUxY2YyNDA3ZjFiMzUxZWI2NzNkNmUxOGI4MDBlMzAxMDI0ZmNhNDU1ZWI3ZTc0MzZmNGUwNDdlYTc5M2U3NDgzZWY3NTA1Mjk5MjM1\" BORDER=0 WIDTH=1 HEIGHT=1> \",\n imageSrc: \"http://cdn.adsnative.com/media/13963/2eebfcac-2daf-4701-b95f-983bf55bb8c4.jpg\",\n promotedByTag: \"Promoted by\",\n backgroundColor: \"#FFFFFF\",\n sid: \"a4e02a370f14435981759943ba34b4f1_9828bfaa\",\n brandImageUrl: \"\",\n embedUrl: \"http://api.adsnative.com/v1/creative.html?crid=I2YQY5UA&sid=a4e02a370f14435981759943ba34b4f1_9828bfaa\",\n type: \"video\"\n },\n cid: \"QFD8YE74\",\n crid: \"I2YQY5UA\",\n zid: \"ping\",\n sid: \"a4e02a370f14435981759943ba34b4f1\",\n uuid: \"cca6ce37-e8fc-49c5-b528-050f5a114378\"\n}", "language": "json" } ] } [/block] VAST url response will be <wrapper> response which contains the 3rd party VAST tag redirect along with AdsNative tracking URLs as shown below [block:code] { "codes": [ { "code": "<VAST\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"vast.xsd\" version=\"3.0\">\n <Ad>\n <Wrapper>\n <AdSystem>AdsNative</AdSystem>\n <VASTAdTagURI>\n <![CDATA[ http:://upload.omnivirt.com/vpaid/24.xml ]]>\n </VASTAdTagURI>\n <Impression>\n <![CDATA[\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=impression&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2YjlmO\n]]>\n </Impression>\n <Creatives>\n <Creative>\n <Linear>\n <!-- <Duration></Duration> -->\n <TrackingEvents>\n <Tracking event=\"start\">\n <![CDATA[\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=view&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2YjlmOGMzOTM\n]]>\n </Tracking>\n <Tracking event=\"firstQuartile\">\n <![CDATA[\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_25&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2Yjlm\n]]>\n </Tracking>\n <Tracking event=\"midpoint\">\n <![CDATA[\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_50&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2Yjlm\n]]>\n </Tracking>\n <Tracking event=\"thirdQuartile\">\n <![CDATA[\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_75&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2Yjlm\n]]>\n </Tracking>\n <Tracking event=\"complete\">\n <![CDATA[\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=duration_complete&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2\n]]>\n </Tracking>\n </TrackingEvents>\n <VideoClicks>\n <ClickTracking id=\"\">\n <![CDATA[\nhttp://bevo-us-east-1.adsnative.com/vv.gif?tag_name=click&amp;data=MzdlYmZiMDhmODg1MTUzNjUyYmE3NTIyMTJjYTlmMTgxNjJkNzkzNGZhOGEwZjlmYmUwZDYwODExNDJlNjNkZTg2OTU2NDhkM2Q3NDhkYzA3YzMwNDE0YWExNzI5Y2E2YjlmOGMzOT\n]]>\n </ClickTracking>\n </VideoClicks>\n </Linear>\n </Creative>\n </Creatives>\n </Wrapper>\n </Ad>\n</VAST>", "language": "xml" } ] } [/block]