JavaScript API

Navegg the JavaScript API provides a set of functions that facilitate “client-side” access to Navegg data.

Browse data with JavaScript API

To get data from an Internet user within the segments of Navegg criteria, we use the following function:

Important: The ID must be replaced with your account ID!

Blocked content

Sign in to view this content.

Example – to get data on the age of a user, use the following code:

Blocked content

Sign in to view this content.

Multivalued criteria segments

Some criteria have unique result where the user can have only one segment per criteria. Other criteria may have multi-valued results, where the user can have more than one segment per criteria. In these cases the segments are separated by the character ““. See the list of segments and their respective examples for reference:

Blocked content

Sign in to view this content.

The Javascript API fetches the data of the user asynchronously. To ensure the availability of the users data, the API implements two callback methods.

The code implemented inside these functions is executed after receiving user data.

Blocked content

Sign in to view this content.

Criteria and Segments

The list of “Criteria segments” and “Segments” available can be found in the Segments section.

Custom Segments with JavaScript API

The Custom Segments feature allows you to create targets based on certain content or actions within yout site. Also allow you to create Retargeting lists or campaigns.

These segments must first be created in the DMP Navegg. Both are activated within the JavaScript API for the same criterion, called “custom”.

It can use the JavaScript API to mark a user in a custom segment or a Retargeting segment. For this it is necessary to consult the Segment ID, previously created in the DMP Navegg. The implementation will be as follows:

Blocked content

Sign in to view this content.

  • The ID represented in the script refers to the account ID. The number reported by Navegg early in the account creation process.
  • The CUSTOM_ID represented in the script refers to the CUSTOM ID previously created in the DMP Navegg.

Conversions with JavaScript API

Navegg Brands’ customers can implement the conversion tag to monitor sales conversions. The javascript conversion tag that must be inserted in the conversion page, which is usually the sale’ confirmation page. Please find below the conversion’s tag template:

Blocked content

Sign in to view this content.

  • The “0.00” value must be substituted for the purchase’s value, in order for our system to receive and process the conversion value information.

Note that conversion call has, as a prerequisite, the implementation of the Javascript Tag, as specific documentation.

Technical Examples

Two examples of how this integration can be done, with JavaScript and PHP:

 JavaScript – If you have access to the purchase’s value in a javascript variable, you must substitute “0,00” for “sale_value”

Blocked content

Sign in to view this content.

  • The “98.99” value must be substituted for the purchase’s value, in order for our system to receive and process the conversion value information.

 PHP – If you have access to the purchase’s value in PHP variable, you must substitute “0,00” for “$sale_value”

Blocked content

Sign in to view this content.