Publishers can trigger a Verity GumGum Contextual analysis request whenever a page in their content network is visited. Callback functions can be implemented to use the Verity GumGum Contextual result analysis data. For example, a callback could publish targeting keywords using Verity GumGum Contextual data, then fetch new ads using Google Publisher Tag refresh functionality. The page can be configured to disable the initial loading of ads until Verity GumGum Contextual returns analysis data.
This convenient way to integrate with Verity GumGum Contextual involves specifying the Verity GumGum Contextual JS (JavaScript) tag on the publisher’s web pages. This section explains how to use the Verity GumGum Contextual JS tag.
Before Using the
...
GumGum Contextual Tag
Before using the Verity GumGum Contextual JS tag, publishers need to set up one or more unique Zone IDs with GumGum. A Zone ID enables Verity GumGum Contextual to authenticate requests from publishers. A Zone ID comprises a UUID assigned to a set of publisher domains. For example:
Zone ID | Domains |
|
Note: Requests to Verity GumGum Contextual from domains not assigned to the Zone ID are denied.
The steps to get a new Zone ID are as follows:
The publisher gathers the list of hosts where the
...
GumGum Contextual JS tag will be used, for example:
The publisher emails
...
GumGum Contextual-support@gumgum.com with the list of host names. At least one host name must be specified.
...
GumGum Contextual Support responds with a unique UUID value to be used as the Zone ID, for example:
zoneId = 46b12cfd-9b63-40bf-a632-2710ec8e31bf |
If the list of hosts changes, the publisher must contact Verity GumGum Contextual Support to update the Zone ID.
*Please note, API Keys and Zone IDs will be provided by Verity GumGum Contextual Team.
Using the
...
GumGum Contextual JS Tag
To use the Verity GumGum Contextual JS page tag, the publisher will specify the Verity GumGum Contextual JS tag in a client-side HTML <script> tag on the pages in their content network and configure their Zone ID and API authentication key.
Follow these steps to implement the Verity GumGum Contextual JS tag:
Include the following <script> tag, preferably within the web page <head> tag:
<script async src="https://js.
...
GumGum Contextual.gumgum.com/vpt.min.js"></script>
Initialize the following configuration object to the windowobject:
Code Block language js window.
...
GumGum ContextualConfig = { apiKey: ‘<API Key supplied by GumGum>’, zoneId: ‘<Zone Id supplied by GumGum>’ }
Note: The page URL is extracted byvpt.min.js
usingwindow.location.href
.Optionally, callback functions may be passed to
...
GumGum Contextual to execute once
...
GumGum Contextual API returns a response.
Note: The response may be for a page classification with any status, so the callback should handle each possible status message. See Page Application Status Codes for details about status messages that
...
GumGum Contextual may return.
Code Block language js window.
...
GumGum Contextual.cmd.push(function(data, error) { // do something }); }
Callback functions can be implemented to use the
...
GumGum Contextual result data. For example, a callback could publish targeting keywords using
...
GumGum Contextual data, then fetch new ads using the Google Publisher Tag
googletag.pubads().refresh()
. For example:Code Block language js window.
...
GumGum Contextual.cmd.push(function(data, error) { console.log(
...
‘GumGum Contextual done’, window.
...
GumGum Contextual.getKeywords(), data, error); google tag.cmd.push(function() { googletag.pubads().setTargeting(‘keywords’, window.
...
GumGum Contextual.getKeywords().concat([
...
‘GumGum Contextual’])); googletag.pubads().refresh(); }); }
Example
...
GumGum Contextual JS Implementation
The following web page shows an example Verity GumGum Contextual JS tag implementation, where the page disables the initial loading of ads until Verity GumGum Contextual returns analysis data.
Code Block | ||
---|---|---|
| ||
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>This article has contextual ads!</title> <script async src="https://js.verityGumGum Contextual.gumgum.com/vpt.min.js"></script> <script async src="https://securepubads.x.net/tag/js/gpt.js"></script> <script> window.googletag = window.googletag || { cmd: [] }; googletag.cmd.push(function () { console.log('Google Tag 1st command'); var adSlot1 = googletag.defineSlot('/6355419/Travel/Europe/France', [728, 90], 'div-gpt-ad-123456789-0'); adSlot1.addService(googletag.pubads()); adSlot1.setTargeting('position', ['atf']); googletag.pubads().disableInitialLoad(); // This would be required googletag.enableServices(); }); window.verityConfigGumGum ContextualConfig = { apiKey: 'API_KEY', zoneId: 'ZONE_ID', }; window.verityGumGum Contextual = window.verityGumGum Contextual || { cmd: [] }; window.verityGumGum Contextual.cmd.push(function(data, error) { console.log('VerityGumGum Contextual done', window.verityGumGum Contextual.getKeywords(), data, error); googletag.cmd.push(function () { googletag.pubads().setTargeting('keywords', window.verityGumGum Contextual.getKeywords().concat(['VERITYGumGum Contextual'])); googletag.pubads().refresh(); }); }); </script> </head> <body> <h1>Verity<h1>GumGum Contextual enables all websites to serve contextually relevant Advertisment!</h1> <div> <h2>But first a word from our sponsors</h2> <div id="div-gpt-ad-123456789-0" style="width:728px;height:90px;background:lightcyan"> <script> googletag.cmd.push(function () { googletag.display("div-gpt-ad-123456789-0"); }); </script> </div> </div> <article> <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit.</p> <p>Nobis nam possimus ut ullam repellat? Animi libero consectetur nihil earum tempora, eos veritatis fugiat laborum totam sint, consequatur, nobis culpa cupiditate!</p> <p>Nisi voluptatem sit rerum sed. Magni, voluptatum! Dolore assumenda minima saepe? Nisi, mollitia officia. Eius, deleniti magni?</p> ... </article> </body> </html> |