📋
Tolstoy
  • Welcome
  • API Reference
    • User
    • Video
    • Webhook
    • Project
  • JavaScript SDK
    • Installation
    • Configuration
    • Identify
    • Events
Powered by GitBook
On this page
  • Tolstoy Widget Code
  • Single Tolstoy Code
  • Tolstoy User

Was this helpful?

  1. JavaScript SDK

Installation

Learn how to install the Tolstoy Widget on your site.

Tolstoy Widget Code

Add the following script at the head on your site:

  • Replace {{APP_KEY}} with your account App Key.

<script>
  window.tolstoyAppKey='{{APP_KEY}}';
  var s = document.createElement('script');
  s.type = 'text/javascript';
  s.async = true;
  s.src = 'https://widget.gotolstoy.com/widget/widget.js';
  document.head.appendChild(s);
</script>

For Shopify users the script is added automatically using the Script​Tag API

Single Tolstoy Code

If you want only a single widget on a single page you can also load just the Widget ID

  • By using this you won't be able to use rules and conditions.

# Replace the window.tolstoyAppKey='{{APP_KEY}}';
window.tolstoyWidgetId='{{TOLSTOY_ID}}'

Tolstoy User

If you know the logged in user you can add his email for better tracking.

window.tolstoyUser='{{email}}'
PreviousProjectNextConfiguration

Last updated 3 years ago

Was this helpful?

If you want to add specific Rules & Triggers on users you can skip this and use

Identify