Implement the Widget Using Javascript | Taboola

Implement the Widget Using Javascript

Implement the Widget Using Javascript

Watch the video tutorial or read below to learn how to implement Taboola's widget using Javascript.

Load the Taboola Library

The Taboola library file contains resources and configurations for a specific publisher site. This small JavaScript file is called loader.js and it must be loaded in order to allow rendering the recommendation module.

It is important to emphasize that the JS library should be called only once when displaying a module. Once the library is loaded, additional commands may be called for setting properties or specifying required actions.

The header (used for asynchronously loading the Taboola script) should be placed in the <head> (preferred) or at the beginning of the <body> of the HTML page.

See the example below (*for reference purposes only, this snippet will not work as your actual code).

Taboola Library - sample javascript code - Publisher Help Center

*click to enlarge