LogoLogo
Click Here For More Support
  • 📍Get Started
    • Welcome
    • Who We Are
    • Our Product
  • 🤖AI Agent Engine
    • AI Agent Engine Basics
      • Get to Know Your AI Agent Engine
      • Glossary
      • Dashboard Overview
    • Manage Your Content
      • Response Types
        • Prewritten Plus Responses
          • Add New Prewritten Responses
          • Edit Prewritten Responses
          • Enrich Prewritten Responses
          • Response Refiner
        • Generated Responses
          • Web-Scraped Data
            • Troubleshooting
          • Documented Data
          • Enrich Generated Responses
        • Fallback Responses
      • Enrichments
        • Buttons
        • Quick Replies
        • Videos
        • Images & GIFs
          • Best Practices
      • Input Director
        • Copy & Paste Input Training
      • Best Practices
        • Locate Responses/Data
        • Revise Responses
        • Unpublish Responses
        • Content Formatting
        • Suppress Thumbs Up/Down
        • Content Groups
      • Upgrade to Context LLM
    • Install Your Chat
      • Web Installation
        • Advanced Pop-Up Options
      • InApp Webview Installation
        • App Provider Product Overview
        • iOS Advanced Install Guide
        • Android Advanced Install Guide
        • Passing Customer Identifiers
    • Enhance the Chat Experience
      • Pages
        • Add/View Chat Pages
        • Maintain State
        • Avatars
        • Chat Header Image
        • Input Container
        • Chat Background
      • Popups
        • Editor Field Definitions
        • Add/Edit Popups
        • Auto-Open
        • Prompt Bubble
        • Popup Button Image
        • Best Practices
      • Page Themes
        • Field Definitions
        • Adjust Page Themes
      • Activation & Drivers
        • Embed Webpages
        • Link Other Chats
        • Welcome Messages
      • Placement
        • Digital Placement
          • Chat Tile
          • Chat in Chat
        • In-Person Placement
      • Sponsor Inclusion
    • Features & Integrations
      • Channels
        • Facebook Messenger
          • Maintenance & Best Practices
        • Inbound SMS
      • Integrations
        • Ticket Commerce
          • Installation/Maintenance
          • Best Practices
        • Simpleview Integration
          • Listings
          • Events
          • Search Logic Summary
        • Zapier
          • Installation Guide
            • Connect to Salesforce
            • Connect to Google Sheets
        • FEVO
          • Installation Guide
          • Best Practices
        • Carbonhouse Integration
      • Features
        • Multi-Language Functionality
        • Mobile Ticketing Guide
        • Food & Beverage Finder
          • Installation/Maintenance
          • Best Practices
        • Weather Feature
        • Consent Form Feature
        • Satisfaction Score
        • 'Notify Subscription' Feature
    • User Management
      • User Types
      • Adjust User Type & Access
      • Add/Remove a User
      • Update Your Password
      • Unlock Your Account
      • Multi-Factor Authentication
    • Reporting & Analytics
      • Analytics Dashboard
        • Overview
        • AI Chat Performance Dashboard
        • Intent Explorer Dashboard
        • Intent Trends Dashboard
        • Intent Deep-Dive Dashboard
        • Bridge Agent Performance Dashboard
        • Mobile Ticketing Guide Dashboard
      • Data Reports
        • Conversation Transcripts
        • AI Resolutions Log
        • URL Link-Outs
        • Bridge Escalations
        • CSAT Entries
        • Ticket Commerce Records
        • End User Contacts
        • NLP Traffic Log
        • Input and Response Log
        • List URL Subscriptions
        • Get Response Feedback
        • Knowtifi Subscriptions
      • API Report Options
      • External IDs
      • UTM Tracking
      • Security Alerts
  • 📬Marketing Engine
    • Marketing Engine Basics
      • Get to Know Your Marketing Engine
      • Glossary
      • Login to Your Account
    • Marketing Calendar
      • How to Use the Marketing Calendar
    • Segments
      • Segments Overview
      • Uploading Contacts Manually
      • Uploading Contacts in Bulk
      • Importing a File into Unsubscribe List
      • Manage Contact Lists
      • Create Custom Object & Custom Fields for Contact Data Management
      • Contact Engagement Rules
      • Folders
      • Audience
        • Audience Dashboard
        • Audience Filters/Segments
        • Create a Meta Audience
        • Create a Audience Using Marketing Engine
      • Best Practices
        • Use Send Time Optimization
    • Templates & Landing Pages
      • Email Templates
        • Create & Preview an Email Template with Dynamic Content
      • SMS/MMS Template
      • WhatsApp Template
        • WhatsApp Carousel Template
        • WhatsApp LTO Template
        • WhatsApp Product Message Templates
      • Webpush Template
      • Mobilepush Template
      • Landing Page Template with a Form
      • Social Conversation Templates
    • Campaigns
      • Messaging Campaigns
        • Select Your SMS/MMS Sender Number
        • How to Create an SMS/MMS Campaign
        • Enable Double Opt-In
        • Messaging Campaign Report
        • Best Practices
        • SMS Regulations
          • SMS Regulations for India
          • SMS Regulations for Canada
          • SMS/MMS Regulations for USA
      • Social Campaigns
      • Email Campaigns
        • Create an Email Campaign
        • Update an Email Campaign
        • Email Campaign Report
        • Smart AI Tools
        • Best Practices
          • Reduce SPAM rate in emails
          • Craft Compelling Email Pre-Header Text
    • Journeys
      • Overview
      • Journey Blocks
      • Journey Templates
      • Create a Journey
      • Variant Testing
      • Conversion Tracking
      • Campaign or Journey Metadata
      • Advanced Filters for Sorting Campaigns/ Journeys
      • WhatsApp Journey
        • How to Use WhatsApp for Commerce
        • How to Send a WhatsApp One-Way Notification
        • Send a WhatsApp Audio Message
        • Automated WhatsApp Welcome Journey
        • WhatsApp Journey Report
      • Best Practices
        • Email Journey Strategy for Ticket Buyers
        • Journey Examples
    • Settings & Integrations
      • Integrations
        • Ticketing Integrations
          • Ticketmaster Integration
            • Best Practices
          • SeatGeek Integration
          • Glitnir Ticketing Integration
        • E-Commerce Integrations
          • Shopify
        • Website Tracking
          • Track Your Website
          • JavaScript Tracking Client
          • Track WordPress Websites
          • Track Shopify Stores
          • Enable User ID Tracking
        • Zapier Integration
      • User Management
        • Account Types
        • Add/Remove a User
        • Adjust Role & Access
        • Update Your Password
        • Two-Factor Authentication
      • Settings
        • Add Email Sender Addresses to Launch Campaigns
        • Connect Your Email Domain with the Marketing Engine
        • Connect Your Social Accounts
        • Connect your Shopify Store
        • Integrate Webpush Notifications
        • Setup Segment-based Engagement Rules
    • Factcubes
      • Fan Maturity Model
  • 💬Live Agent Engine
    • Get to Know Your Live Agent Engine
    • System Configuration
      • Installation Guide
      • Escalation Schedule
      • Multiple Team Involvement
      • Leave a Message & Contact Collection
      • Conversation Labels
      • Additional Channels & Placement
        • Bridge Placement
        • Bridge Email
          • Installation Guide
        • Facebook Messenger
    • Agent Overview
      • Logging In
      • Dashboard Overview
      • Profile Setup
      • Notification Preferences
      • Set Your Availability
      • Conversation Status
      • Assign a Conversation
      • Reply in a Conversation
      • Canned Responses
        • Add/Use a Canned Response
        • Modify/Delete a Canned Response
        • Best Practices
      • Participate in a Conversation
      • Private Notes & Mentions
      • Mute/Block a User
      • Prioritize Conversations
      • Resolve a Conversation
      • Export Transcripts
      • Macros/Automation
      • Keyboard Shortcuts
      • Ending Your Shift
      • Troubleshooting
    • Admin Overview
      • Adjust Team Assignments
      • Update Agent Status
      • Additional System Controls
    • Data & Reporting (Bridge)
    • Bridge Mobile App
  • SYSTEM UPDATES & SUPPORT
    • Help Center
    • Release Notes
      • Archived Product Updates
Powered by GitBook
On this page
  • Track an Interaction Semi-Automatic
  • Tracking Content Impressions and Interactions Manually
  • Tracking Content Impressions When it Scrolls into View
  • Manually Trigger Events
  • Social Login Tracking

Was this helpful?

  1. Marketing Engine
  2. Settings & Integrations
  3. Integrations
  4. Website Tracking

JavaScript Tracking Client

Last updated 2 months ago

Was this helpful?

You can use the JavaScript tracking client to track any application that supports JavaScript, including websites!

To find the tracking code for your website, follow the steps below:

  1. Click Settings

  2. Click Integrations

  3. Click Website

  1. Click on “Copy Script” for the website you wish to track.

  1. Paste the JavaScript tracking code into your pages, just after the opening <body> tag (or within the <head> section)

The tracking code looks as follows:

<!-- Factoreal --> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setCookieDomain", "*.store.combifam.com"]); _paq.push(["setDoNotTrack", true]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://webanalytics.factoreal.com/"; _paq.push(['setTrackerUrl', u + 'js/tracker.php']); _paq.push(['setSiteId', '60']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'js/tracker.php'; s.parentNode.insertBefore(g, s); })(); </script> <noscript> <p> <img src="https://webanalytics.factoreal.com/js/tracker.php?idsite=60&amp;rec=1" style="border:0;" alt="" /> </p> </noscript> <!-- End Factoreal Code -->

If you're familiar with JavaScript, this code may look strange. That's due to the fact its made to run asynchronously. In other words, browsers will not wait for the js/tracker.php file to be downloaded to show your page.

Track an Interaction Semi-Automatic

Interactions with content blocks are usually tracked automatically as soon as a visitor clicks on them. In certain cases, you may want to trigger an interaction manually. For instance, there may be a case where you want to trigger an interaction based on a form submission or a double click. To do so call the method trackContentInteractionNode(domNode, contentInteraction).

<script> formElement.addEventListener("submit", function () { _paq.push(["trackContentInteractionNode", formElement, "submittedForm"]); }); </script>

Tracking Content Impressions and Interactions Manually

You should use the method trackContentInteraction(contentInteraction, contentName, contentPiece, contentTarget) to track an interaction on your website. The example below shows how to track a click on a button; however, the same principle can be applied to any block on the site that you want to track clicks on.

<script> const button = document.querySelector("#button_to_be_tracked"); button.addEventListener("click", function () { _paq.push([ "trackContentInteraction", "click", "Click Me", "contextual text", "https://www.example.com" ]); }); </script>

Tracking Content Impressions When it Scrolls into View

You should use the method trackContentImpression(contentName, contentPiece, contentTarget) to track impressions on specific blocks on your website.

The below example shows how to track a carousel when it scrolls into view:

<script> var ignoreEvent = false; document.addEventListener("DOMContentLoaded", () => { let observer = new IntersectionObserver((entries) => { entries.forEach((entry) => { // This is to prevent duplicate events. if (ignoreEvent) return; if (entry.isIntersecting) { _paq.push(["trackContentImpression", "View", "Carousel"]); // We set this is true so we don't register the same event twice. ignoreEvent = true; } }); }, { root: null, rootMargin: "0px", threshold: 1.0, }); let target = document.querySelector("#track_carousel"); observer.observe(target); }); </script>

Manually Trigger Events

By default, Satisfi Labs tracks page views when the JavaScript tracking code loads and executes each page view. However, on modern web applications, user interactions do not necessarily involve loading a new page. For example, when users click on a JavaScript link, or when they click on a tab (which triggers a JS event), or when they interact with elements of the user interface, you can still track these interactions with Factoreal.

To track any user interaction or click with Factoreal, you can manually call the JavaScript function trackEvent(). For example, if you wanted to track a click on a JavaScript menu, you could write:

<a href="#" onclick="_paq.push(['trackEvent', 'Menu', 'Freedom']);">Freedom page</a>

Social Login Tracking

This can also be used to track any other custom event. For Example, on Google Login you can add this event to the Factoreal CDP:

<script> function handleCredentialResponse(CredentialResponse){ // decodeJwtResponse() is a custom function defined by you // to decode the credential response. const responsePayload = decodeJwtResponse(response.credential); _paq.push(['trackEvent', 'Login', 'google', responsePayload.email]); } window.onload = function () { google.accounts.id.initialize({ client_id: 'YOUR_GOOGLE_CLIENT_ID', callback: handleCredentialResponse }); google.accounts.id.prompt(); }; </script>

Don't hesitate to get in touch with our team at with any questions you may have!

📬
me-support@satisfilabs.com