Tracking data from external websites

November 14, 2023

With jExperience, you can collect data from websites, portals, or applications that are not created using Jahia CMS. For example, if you’ve created sites using WordPress, Drupal, or a custom application, you can still use jExperience to collect data.

Note: This feature is available on JExperience 2.1 and above.

To collect data you:

  • Enable the External Site option for your site
  • Copy the tracking code snippet from jExperience and add it to your external site
Note: The steps in this topic are not required when you're working on websites created with Jahia. Read this topic only if you want to track data from a site created outside of Jahia.

Prerequisites

These prerequisites are not required when using a free trial version of Jahia.

Security and GraphQL API

Before you configure Jahia to collect data, your developer must ensure that the Jahia GraphQL API is available to the domain you are using. More information can be found in the authentication and authroization section in Using GraphQL to perform queries

Project

We recommend that you keep internal and external websites separate and create a dedicated project (from Jahia>Administration) corresponding to your external website.

Enabling the External Site option

After creating your project, enable the External Site option for your site. 

To enable the option:

  1. In Page Composer, navigate to the top-level site node for your site.
  2. Right-click and select Edit from the shortcut menu.
  3. In Content, scroll down and enable jExperience - External Site, as shown in the following example.
  4. Click Save.

Copying the tracking code snippet to your external site

By default, the tracker collects the following data:

  • URL of the page
  • Referrer
  • Page title
  1. In jExperience, navigate to Projects>Tracking information.
  2. If necessary, refresh the page.
  3. In Tracking Information, click Copy tracking code.
    external-websites-02.png
  4. Next, copy the tracking code to your external site. Add the snippet to the <head> tag in your web page using your CMS or Google Tag Manager.
  5. To verify that tracking works correctly, in jExperience navigate to Projects>Metrics>Most visited pages. You should see data indicating that you have page views.