ActivEngage JavaScript SDK

Design philosophy

The current ActivEngage JavaScript is the second generation of our product (ie PageView2 or Pv2 for short). PageView is modular by design and event driven. Our script has to work across all browsers and along side all website providers. As such we attempt to be good citizens.

Optimization

As part of that effort we have focused on Pv2 to make sure it is optimized in several ways.

  1. We only load modules that are absolutely necessary. If the customer doesn't want a specific function of our script it won't be loaded on to the page.
  2. We've worked to compress and minimize our modules as much as possible.
  3. All of our scripts and calls are cached at the CDN layer where possible.

We're continuing to make improvements and value any feedback you may have.

Getting Started

Like we mentioned at the start Pv2 is incredibly flexible the level of integration is up to you the implementor. But to get started you'll need to our JavaScript to your page.

Adding PageView.js

To get started all that needs to be added is a single line of JavaScript. That's been our goal since day one and it continues to be our goal for those who want the least amount of work to get our chat up and running.

<script async="" defer="" src="https://pageview.activengage.com/js/pageview.min.js"></script>
1

Account Detection

As you probably noticed there's nothing in that URL that signifies the customer account to be used. That's because by default we'll use the domain of the site we're on to pull the correct account information. Specifically we'll use:

window.location.hostname;
1

This can be overriden by specifying a chat-account attribute on the <body> element of the page. For example:

<body chat-account="www.test.com">
1

Call-to-Actions

Another thing missing from the above script is an indication on the call-to-actions to be presented the visitor. In our most basic of setups ActivEngage can control the CTAs. We have several CTA options.

  • Launcher
  • Invite
  • ActivTarget

These options can be turned off and on from the ActivEngage designer. The Pv2 script will download a cached configuration and present the appropriate CTAs. To learn more about these options see our section on CTA Config.

Last Updated: 10/14/2025, 2:20:10 PM