Skip to main content
Topsort’s analytics.js public library allows marketplaces to easily send Topsort interaction events, such as clicks, impressions and purchases, with a low-code integration. By using a simple HTML tag, the marketplace can connect to Topsort’s ad server and send all tracking events related to an ad.

Installation

You can install the library using npm:

Configuration

At your application’s entry point, e.g. index.js

Marking Promoted Elements

To allow Topsort to automatically track clicks, impression and purchases, use the HTML element data-ts-* to mark promoted elements in the page.

Organic (non-promoted) elements

Clickable areas

Use data-ts-clickable to indicate what areas should trigger a click event:
For banner ads with product attribution:

Purchase tracking

Use data-ts-items JSON array to track purchases:

End to End Example

Note that banners.js is required for topsort-banner tag, to learn more check Banners.js documentation.