News! SmartSender.io becomes Wooxy. Read a post from the CEO Arrow
January 11, 2022

How to use JS API

This essential integration uses a JavaScript snippet, a block of code inserted into your website. It’s a low-impact way to send data to Wooxy.com — through your users’ web browsers. While an API integration is more flexible, this is a quick way to get started.

Things to know before you start:

  • We only track activity for users registered on your website after the JS Script is called.
  • We do not track anonymous or unregistered user activity.
  • To update an existing user’s variables, send the JS API call again. You must include their identification and any new attribute values.
  • If the variables already exist in their profile, we’ll overwrite them.
  • If there are any new variables included in the call, we’ll add them to the profile.
  • We do not edit the user’s identification method if the contact is already added to the Contact List.
  • A JavaScript API makes it easy to get started but isn’t essential. You may do everything through our REST API.

To install our JS API, you need to take the following steps:

2. Download and extract Worker File from the archive and add it to the root directory of your website.

3. Include JS code snippet on every page in your app, immediately before the closing </body> tag. 

<script type="text/javascript" src="//js.smartsender.io/js/v1/JS_SCRIPT_ID.js"> </script>

By default, the code contains 2 methods:

JS_Methods-1024x502

JavaScript APIs are API methods that allow you to dynamically interact with the code. Below we will look at all the JS API methods.

You can call JS API methods to manage your user data: