Introduction
Welcome to Seentics! Our mission is to empower you to create intelligent, automated workflows that respond to user behavior on your website in real-time. This guide will walk you through everything from installation to building complex workflows and integrating with your own tools.
Installation
Getting Seentics onto your website is incredibly simple. All it takes is a single line of code.
- Navigate to the Websites page in your Seentics dashboard.
- For your desired website, click the "Tracking Code" button.
- Copy the provided script tag. It will look something like this:
<script async src="http://localhost:3000/tracker.js" data-site-id="6896068177d6b80207231acf"></script>
Paste this snippet into the <head>
section of your website's HTML. Once the script is added, Seentics will immediately begin tracking visitors and become ready to execute any active workflows you've created for that site.
Workflow Concepts
Workflows are the heart of Seentics. They are composed of three fundamental building blocks: Triggers, Conditions, and Actions. Understanding how these interact is key to mastering the platform.
Triggers: The "When"
Triggers are the events that initiate a workflow. They are the "when" something should happen. A workflow can have multiple triggers; it will start if any one of them occurs.
- Page View: Fires as soon as a user lands on a page.
- Time Spent: Fires after a user has been on a page for a specified number of seconds.
- Exit Intent: Fires when a user's mouse moves towards the top of the browser window, indicating they are about to leave.
Conditions: The "If"
Conditions are rules that must be met for a workflow to proceed. They are the "if" statement in your automation. If a condition fails, the workflow stops at that point for that specific user session.
- URL Path: Checks if the user is on a specific page or section of your site (e.g., URL contains `/checkout`).
- Device Type: Checks if the user is on a desktop or mobile device.
- New vs. Returning Visitor: Checks if it's the user's first time visiting your site.
- Tag: Checks if the visitor has a specific tag that was applied in another workflow.
Actions: The "What"
Actions are the final step. They define what the workflow actually does when the trigger fires and all conditions are met.
- Show Modal: Displays a popup modal with a title and content.
- Show Banner: Displays a dismissible banner at the top of the page.
- Add/Remove Tag (Server-Side): Securely adds or removes a tag from a visitor's profile in your database.
- Send Email (Server-Side): Sends an email from your server. This is secure and reliable. It can be sent to the visitor or to a custom address for notifications.
- Webhook (Server-Side): Sends data to an external URL, allowing you to integrate with other services.
Customization & API
Identifying Users
To truly personalize workflows, you need to tell Seentics who your users are. By default, visitors are anonymous. The most reliable method is to call a JavaScript function from your website's code, typically after a user logs in or signs up.
This function call holds the user's data in memory for the current page view only and does not store it in `localStorage`, ensuring better security.
window.seentics.identify('YOUR_USER_ID', { email: "user@example.com", name: "Jane Doe" });
The first argument is the user's unique ID from your database. The second is an object of attributes. This identified information will be automatically used by server-side actions like "Send Email" (to set the recipient) and included in "Webhook" payloads.
Tracking Custom Events
You can track any action that isn't a standard page view or click. This is perfect for things like form submissions, video plays, or other unique interactions. To do this, you track a custom event from your site's code.
window.seentics.track('your_custom_event_name');
Example: Tracking a custom "video-played" event
// Get your video element
const videoPlayer = document.getElementById('product-demo-video');
// Add an event listener
videoPlayer.addEventListener('play', function() {
// Send the event to Seentics when the video starts playing
window.seentics.track('video-played');
});
Tracking Pre-configured Conversion Events
To make things even easier, you can use our pre-configured event names to automatically track primary conversion goals. Using the conversion:
prefix will count the event towards your main dashboard metrics.
- User Signed Up:
seentics.track('conversion:signup');
- Made Purchase:
seentics.track('conversion:purchase');
- Newsletter Signup:
seentics.track('conversion:newsletter-signup');
- Contact Form Submitted:
seentics.track('conversion:contact-submit');
Custom UI (Modals & Banners)
For fully custom experiences, use the "Show Modal" or "Show Banner" actions with Display Mode = Custom. We render your HTML/CSS/JS inside an isolated iframe so your animations and scripts work reliably without affecting the host page.
What you can provide
- Custom HTML: Provide a complete snippet or a full HTML. We automatically extract the body.
- Custom CSS: Paste styles, including keyframes and media queries.
- Custom JS: Vanilla JS; runs when the iframe loads.
Notes
- Iframe sandbox allows scripts and same-origin for functionality while isolating styles from the host.
- We auto-resize the iframe to match content height for banners.
- Close button is overlayed outside the iframe for consistent UX.
Example: Custom Banner
<div class="banner">
<div class="banner-content">
<h1>Create Something <span class="highlight">Amazing</span></h1>
<p class="subtitle">Transform your ideas into reality</p>
<button id="primaryBtn">Get Started</button>
</div>
</div>
html, body { margin: 0; padding: 0; }
.banner { width: 100vw; min-height: 40vh; display: grid; place-items: center; background: linear-gradient(135deg,#667eea,#764ba2); }
.banner-content { max-width: none; padding: 0 1rem; text-align: center; color: #fff; }
.highlight { color: #ffd93d; }
document.getElementById('primaryBtn')?.addEventListener('click', () => {
window.parent?.postMessage({ type: 'banner_cta_click' }, '*');
});
Tip: Track CTA clicks by listening for the posted message in the host page or trigger a workflow Custom Event from your own code.
Using localStorage in Actions
Actions such as Send Email, Webhook, Show Modal/Banner (custom), and Insert Section can read values from your site’s localStorage
and inject them into action fields via placeholders.
- In the action settings, add localStorage keys (e.g.,
cartId
,userPlan
). - Use placeholders like
{{cartId}}
or{{userPlan}}
in Subject, Body, or Webhook JSON.
localStorage.setItem('cartId', 'CART_12345');
localStorage.setItem('userPlan', 'pro');
Subject: "Order {{cartId}} is pending"
Webhook JSON: { "plan": "{{userPlan}}" }
You can also use identified user fields: {{identifiedUser.id}}
, {{identifiedUser.attributes.email}}
when calling seentics.identify()
.
Implementation verified: client collects keys in workflow-tracker.js
, server receives them in the execution payload, and actions resolve placeholders using localStorageData
and identifiedUser
.
Using Webhooks
The "Webhook" action is the primary tool for sending data from your workflows to other services (like Zapier, Make, or your own backend). When a workflow executes a Webhook action, Seentics will send a `POST` request to the URL you specify with a JSON payload containing all available data about the user and event.
To send tag or other event information to your backend, you should chain a "Webhook" action after the "Add/Remove Tag" action in your workflow.
Using Dynamic Data
Server-side actions like "Send Email" and "Webhook" can be personalized with data from the user's browser `localStorage`. This is useful for including dynamic information like a cart ID, a username, or other details your application stores locally.
In the settings for a server action, you can map a `localStorage` key to a `payloadKey`. You can then use this `payloadKey` in your action's text fields (like an email subject) using placeholders, like {{payloadKey}}
. This will be replaced with the actual value from the user's `localStorage` at the time of execution.
Subscription & Billing
Seentics's billing is handled via Lemon Squeezy. The application is fully set up to handle subscription states based on data in your Firestore database. To make this fully functional, you need to set up a webhook in your Lemon Squeezy account to send subscription events to your application.
A complete, step-by-step guide on how to create the webhook handler and what data structure to use is available in the LEMON_SQUEEZY.md
file in the project root. This guide contains the exact code needed for the webhook API route.