Step 1: Install the Analytics Library
Package Manager (Recommended)
Yext Analytics is available via npm or yarn. To install,
npm i @yext/analyticsyarn add @yext/analyticsLocal Install
If you require additional customization or need to fork the library, you can download the source code and reference it in your file structure.
Code Sandbox Vanilla JS Example
To play around with the library and its types, we’ll walk through an example with Code Sandbox.
- Create a new Code Sandbox using the “Vanilla Typescript” Template .
- Under the “Dependencies” section on the left, search for
@yext/analyticsand install it.
<% elem.innerText %>