The Knotch Measurement Unit - Javascript Tag Integration Guide

#Introduction

To locate the JavaScript HTML tag integration:

#Script Tag

We highly recommend loading the JavaScript asset as early as possible. As such, the best placement of the JavaScript asset is within the page's <head> element.

Wanna see it in action? Click here to see a live example.

#Attributes

Attribute(s) Description Type Required
demo Will prevent events from being sent Boolean No
debug Will display integration and events steps in the console. Boolean No

#Unit Placeholder DIV Element

The placeholder <div> element dictates the position of the Knotch Unit on the page. The Knotch Measurement JavaScript asset locates this placeholder, and dynamically renders the correct unit within it.

#Attributes

Attribute(s) Description Type Required
data-width Sets the unit's width; can be in pixel or percentages. String No
data-height Sets the unit's height; can be in pixel or percentages. String No
data-track-current-only Gates this unit's tracking to the current URL. Once the URL changes, the unit will be disabled. Boolean No

#Video Integration

The Measurement JavaScript Tag integration supports the following video player integrations:

In order to add a unit to a video, you need to set a data-knotch on it with the knotch unit id as the value. For example:

<iframe src="https://www.youtube.com/embed/..." data-knotch="KNOTCH-UNIT-ID"></iframe>