Overview
Advisible Development Kit (ADK) is the frontend JavaScript library used to integrate Advisible ads on a website. The type definitions describing the public API of the library can be found in the ADK API reference. These definitions provide detailed information about the available interfaces and are linked throughout the documentation. Practical examples of how to use ADK can be found in the Tutorials section.
ADK implements an abstraction where behavior and content handling are separated into components with specific responsibilities. This is useful in that components can be reused and the content source can be dynamically selected without modifying application logic. Below we describe the main components of the ADK architecture.
Container
Containers attach to selected elements on the page and assume control of their behavior. What will be displayed in the element depends on the linked provider. The ContainerConfigurator provides a set of functions for configuring containers, ranging from lazy loading and stickiness to responsiveness and viewability maximization.
The ContainerApi exposes utility functions for managing the container lifecycle. React applications should use our React library, which eliminates the need for manual container lifecycle management.
Provider
Providers load content in container elements. The main purpose of the provider is to fetch content when requested and display it in the location designated by the container. The following providers are available:
| ID | Description | Parameters |
adk.placement | Implements the API to the Placement Service. It performs ad requests and routes the results to the corresponding adapter frontend for rendering and viewability tracking. This is the default provider if not specified. | PlacementProviderParams |
adk.native.article | Implements the API to the True Native Ad Service for fetching, rendering and tracking direct native articles. The com.advisible.native.article adapter is responsible for rendering and tracking the content. | ArticleProviderParams |
adk.template | Renders a template string directly in the container. | TemplateProviderParams |
Adapter
Adapters in ADK provide the frontend-specific rendering and viewability tracking for content returned by the provider. ADK uses the adapter associated with each result to render it in the container. The following built-in adapters can be configured to be used by the adk.placement provider:
| ID | Kind | Description |
|---|---|---|
com.advisible.content-display | teaser | Renders and tracks Content Display teasers. |
com.advisible.native.teaser | teaser | Renders and tracks True Native teasers. |
com.advisible.native.article | article | Renders and tracks True Native articles. Also used by the adk.native.article provider. |
The available options and template parameters depend on the adapter kind:
| Kind | Options | Template parameters |
|---|---|---|
teaser | TeaserAdapterOptions | TeaserTemplateParams |
article | ArticleAdapterOptions | ArticleTemplateParams |
Template
The template system consists of tools that load templates and produce renderable HTML dynamically using the ADK Template language. Templates can be used in two ADK configuration paths:
- Use
adk.config.addTemplateto register a template for referencing in container configurations. This is the preferred approach for most ad rendering scenarios as it allows for fetching the ad content from a separate provider and reusing templates across different containers/adapters. - Use the
adk.templateprovider mentioned above to render a template string directly in a container. This is intended for small utility containers such as ad marking.
The parameters available for use are provided in four ways depending on how templates are used:
- Built-in adapters described above provide their standard parameters automatically.
- Provide custom parameters with the
templateValuesparameter available onArticleProviderParams,ArticleAdapterOptionsandTeaserAdapterOptions. - When using the
adk.templateprovider, provide parameters using thetemplateParamsprovider parameter. - Provide parameters by adding an input HTML element as a descendant of the container. The
data-adk-paramattribute specifies the parameter name and thevalueattribute specifies the parameter value. ADK reads these values when containers attach and makes them available for use in the template of the container.