Skip to main content
100%

Google Analytics script for ServiceNow tracking

✓ Published0🌍 Public
Aandrew-psch
Last edited Oct 14, 2018
Created on Oct 14, 2018

This example demonstrates how to send ServiceNow page interactions to Google Analytics for tracking. It uses the standard Google Analytics tracking snippet, creating a pageview hit that captures the top-level document title and the current URL location. The code relies on the `ga` function from the Google Analytics JavaScript library, with the `create` command initializing a tracker and the `send` command transmitting the pageview data. The script runs in the browser, reading `window.top.document.title` and `window.location.href` to report activity from within the ServiceNow environment.

AI-generated description

Similar vizzes