Tracking snippet

From Genesys Documentation
Revision as of 13:26, April 28, 2021 by Barbara.martin@genesys.com (talk | contribs) (Published)
Jump to: navigation, search

Learn how to enable visitor tracking on your website.

Prerequisites

About web messaging

Feature coming soon: Web messaging

This article applies only to customers using web chat. If you are a Genesys Cloud customer, we encourage you to use the new web messaging feature to replace web chat. To start tracking, configure Messenger and then use the Messenger JavaScript SDK to configure how you want to track web events.

Overview

Before you begin

Before you deploy the Genesys Predictive Engagement tracking snippet be sure you understand:

Ad blockers

Ad blockers are plug-ins or browser extensions that improve page load times and minimize questionable tracking. The majority of ad blockers tested with out-of-the-box settings do not interfere with Genesys Predictive Engagement's tracking capabilities. However, there are a couple considerations if you use uBlock Origin:

  • uBlock Origin disables Genesys Predictive Engagement's tracking web beacons; this effectively prevents Genesys Predictive Engagement's tracking capabilities.
  • uBlock Origin and uBlock Plus Adblocker block popular tag managers such as Adobe Tag Manager, Google Tag Manager, and more.
Important
If you use a tag manager to manage JavaScript and tracking on your website, consider adding ad blocker detection to your site to notify visitors with detected ad blockers that they may be missing some important functionality. Also, instead of using a tag manager to deploy the Genesys Predictive Engagement tracking snippet, consider placing the tracking snippet directly in the body or header of your website.

Copy the snippet

Genesys Predictive Engagement provides a tracking snippet that you can copy and paste. Since you are logged in to Genesys Cloud, the tracking snippet already contains your organization ID and region.

  1. Determine which snippet to use:
  2. In Admin in Genesys Cloud, open the Global Settings page and then click the Tracking Snippet tab.
  3. Copy the tracking snippet.
  4. Paste the snippet. For more information about where to paste the snippet, see Deploy the snippet.

Types of tracking snippets

Website snippet

The Website snippet provides tracking support to traditional webpages that contain little or no dynamic content. Traditional websites load a new HTML page whenever the visitor navigates to a different URL. To provide tracking support to traditional webpages, the Website snippet calls ac('pageview') each time the web browser loads a new page.

SPA snippet

The SPA snippet can track activity on Single Page Applications (SPAs). SPAs load dynamic content on demand without requiring a hard reload of the HTML page. The SPA snippet can also track when visitors click relative links, which the Website snippet does not. The SPA snippet works on SPAs such as Angular, React, and Vue.js. For more information about the additional tracking options available with the SPA snippet, see autotrackURLChange.

Snippet recommendations

If you have this type of website... Use this snippet...
Not sure SPA
Mix of traditional and SPA pages SPA
Traditional pages only Website

Customize how the snippet tracks activity (optional)

You can customize how the snippet tracks activity on your website:

Deploy the snippet

After you copy the snippet, review the deployment notes. Then, follow the instructions to deploy the tracking snippet:

Deployment notes

  • Deploy the widgets transport above the location where you deploy the Genesys Predictive Engagement tracking snippet.
  • Deploy the Genesys Predictive Engagement tracking snippet on the main window of the website to track.
  • Paste the tracking snippet in the head section of the website template page before the closing tag.
  • Do not deploy the tracking snippet in an iframe.
  • The Genesys Predictive Engagement tracking snippet loads JavaScript asynchronously without slowing down page loading. For more information about how the tracking snippet works, see About the tracking snippet.


Deploy the snippet with a tag manager

To deploy the Genesys Predictive Engagement tracking snippet, use your preferred tag manager. For example:

Important
  • Deploy the widgets transport above the location where you deploy the Genesys Predictive Engagement tracking snippet.
  • uBlock and other ad blocking software is known to block tag managers, in which case the tracking snippet deployed through the tag manager would also be blocked. For more information, see Ad blockers.

Deploy the snippet manually

  1. On the Tracking Snippet page in Genesys Cloud, copy the type of tracking snippet that you need.
  2. Before you paste the snippet on your website, review the deployment notes.
Important
Deploy the widgets transport above the location where you deploy the Genesys Predictive Engagement tracking snippet.

Verify that the snippet works

When the tracking snippet is executed properly and initialized:

  • Use Live Now to verify that Genesys Predictive Engagement is tracking your website activity.
  • You should see an update every 4-5 seconds.

Troubleshoot the snippet

If the tracking snippet does not work properly when you load your web pages, check the following things:

  • Is the snippet on the correct page?
  • Is the snippet placed correctly in the header?
  • Are all of the parameters specified correctly?
  • Are there any typos, missing characters, or extra white space?
  • Were any characters replaced with their printable equivalents?
  • Is the domain on the list of allowed domains?

For more suggestions, see Deployment notes.

Error reference

Error code Description
403 error Is your domain in the list of allowed domains?
404 error Is there extra white space in the snippet?

Note: In a URL, white space is encoded as %20.

Bad request Is there extra white space in the snippet?

Note: In a URL, white space is encoded as %20.

Initialization error Are there any of the following in the snippet:
  • Typos
  • Missing characters
  • Dashes and quotes in URLs replaced with printable equivalents
Comments or questions about this documentation? Contact us for support!