• Features
  • API Docs
  • Help Center
  • Log in
  • Sign Up
  • Features
  • API Docs
  • Help Center
  • Log in
  • Sign Up

How to use JS API

47 views January 11, 2022 0

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 SmartSender.io — 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:

  1. Generate and get JS code snippet.
  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>
  4. Properly identify your user.
  5. Call JS API methods to manage your user data.

By default, the code contains 2 methods:

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:

  1. Create and Update Contact.
  2. Fire Event.
  3. Web Push Prompt.
  4. Telegram Link.
Similar posting
  • Integration with Mailchimp
  • Zapier Integration
  • JS API methods
  • Add contact manually
  • Web Push Prompt Settings in JS
  • How to fire event via JS
Company
  • About us
  • Team
  • YouTube
  • Facebook
  • Google Business
Legal
  • Terms of Use
  • Privacy Policy
  • Anti-Spam Policy
  • Cookie Statement
Resources
  • Api Documentation
  • FAQ
  • Knowledge Base
  • SmartSender Blog
  • Marketplace

We use cookies to make SmartSender’s website a better place. Cookies help to provide a more personalized experience for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).

got it