Trigger a Page Analysis Request
Publishers can trigger a GumGum Contextual analysis request whenever a page in their content network is visited. Callback functions can be implemented to use the GumGum Contextual result analysis data. For example, a callback could publish targeting keywords using 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 GumGum Contextual returns analysis data.
This convenient way to integrate with GumGum Contextual involves specifying the GumGum Contextual JS (JavaScript) tag on the publisher’s web pages. This section explains how to use the GumGum Contextual JS tag.
Before Using the GumGum Contextual Tag
Before using the GumGum Contextual JS tag, publishers need to set up one or more unique Zone IDs with GumGum. A Zone ID enables 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 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 GumGum Contextual Support to update the Zone ID.
*Please note, API Keys and Zone IDs will be provided by GumGum Contextual Team.
Using the GumGum Contextual JS Tag
To use the GumGum Contextual JS page tag, the publisher will specify the 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 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 window object:
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.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: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 GumGum Contextual JS tag implementation, where the page disables the initial loading of ads until GumGum Contextual returns analysis data.
Related content
The contents of these documents and any attachments contain GumGum, Inc. confidential information and are legally protected from disclosure.