Add Web Analytics Tracking Snippets to Sites and Pages

A service administrator can add JavaScript tracking code to sites for web analytics tracking, making it easier to integrate with external analytics providers like Google, Adobe, or Oracle Infinity. You can also add the snippet to individual sites or pages, customizing it as necessary.

A service administrator can configure a script that will ripple down into all the sites and pages. At the site level, a service administrator can customize the script; for example, with a different web property ID for the site. At the page level, a service administrator can customize the snippet further, like marking the page as part of a campaign.

Add a Web Analytics Tracking Snippet for Sites

To add a web analytics tracking snippet for all sites in an Oracle Content and Experience instance:

  1. Under Administration in the left navigation menu, choose Settings.
  2. On the Settings page, from the General drop-down menu, choose Sites. Near the bottom of the site-specific settings is a Web Analytics Tracking Snippet area, where a service administrator can add a web analytics tracking snippet, like the following one for Google Analytics:
    <!--Global site tag (gtag.js - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-85172963-3"></script>
    <script>
    window.dataLayer = window.dataLayer || O:
    function gtag0{dataLayer.push(arguments);}
    gtag('js', new Date0;
    
    gtag('config', 'UA-85172963-3'):
    </script>

    To revise the tracking snippet, click the Edit button at the bottom.

    After the tracking snippet is added to the Settings page, whenever you create a new site, the snippet is added to the site’s settings after you edit the site and turn it on.

Modify a Web Analytics Tracking Snippet for a Site

A service administrator can modify the snippet for a site:

  1. In the left navigation menu, choose Sites.
  2. Open the site.
  3. In the top menu, select View and then provide a name and description for the update in the New Update dialog box.
  4. In the Settings menu on the left, click Analytics.
  5. In the JavaScript Tracking Snippet area, you can customize the script for site-specific tags, identifiers, or other tracking metrics.
  6. At the top of the Analytics page, select Enable tracking snippet for the site.

    After you edit the snippet, a message says that the script has been modified. There is also a button you can click to revert your changes:Restore to Latest Tenant Script.

  7. When you finish revising the tracking snippet, save the site.

To revert your changes in the tracking snippet for the site, click Restore to Latest Tenant Script at the bottom of the page and then save the site.

Modify a Web Analytics Tracking Snippet for a Page

A service administrator can modify a web analytics tracking snippet for a page in a site:

  1. Open the Settings page for one of your site’s pages.
  2. Scroll down to the JavaScript Tracking Snippet area.
  3. Customize the script for site-specific tags, identifiers, or other tracking metrics.
  4. Under Analytics Options, select Override tracking snippet on this page.
  5. After you edit the snippet, a message says that the script has been modified from the site script. There is also a button you can click to revert your changes: Restore to Latest Site Script.
  6. When you finish revising the tracking snippet, save the page.

Viewing Site and Page Analytics Data

After you publish a site that includes a web analytics tracking snippet and bring the site online, you can view the tracked analytics data on the vendor’s site, such as Google Analytics. If you used a snippet for Oracle Infinity analytics tracking, go to the Oracle Infinity home page and click Analytics to view the data and select or create reports.