Proem Sports Documentation
  • FUNDAMENTALS
    • Getting Started
      • Platform Overview
      • Fans
      • Account setting
        • Settings
        • Do Not Disturb (DND)
        • Frequency capping
      • Integrations
        • Web tracker
        • App Tracker
        • Setting up email service provider
          • Setting Up SendGrid as the Email Service Provider on Organon
          • Setting Up Mailjet as the Email Service Provider on Organon
        • Web push soft ask integration
        • Push notification integration
          • Setting Up Android Push Notifications
          • Setting Up iOS Push Notifications
          • Setting Up Web Push Notifications
      • File upload
        • How to upload files in Organon
      • Analytics
      • Social Media & Benchmarking
      • Segments
      • Marketing
        • Email
        • WhatsApp
        • Push Notifications
        • SMS
      • Forms
  • Segment creation
    • Segment operators
      • Working with groups
    • Finalising the segment
    • Saving the segment
    • Managing a segment
    • Segment overview
    • Syncing with Meta Custom audiences
  • Steps to Using Email
    • Email campaign set up
    • Desiging Email campaigns
    • Audience and Scheduling
    • Review and Publish
  • WhatsApp campaign set-up
    • Creating a WhatsApp campaign
    • Setting Up the Campaign Content
    • Audience and Scheduling
    • Review and Publish
    • Campaign reports
  • SMS campaign set-up
    • Creating a SMS campaign
    • Audience and Scheduling
    • Review and Publish
    • Campaign Reports
  • Push notification campaign set-up
  • Push notification campaign process
  • Campaign reports
    • Email Campaign Report
    • Push Notification Campaign Report
  • Forms
    • Form set-up
    • Form design
    • Form save and publishing
    • Form reports
Powered by GitBook
On this page
  • Overview
  • Prerequisites
  • Step 1: Integrate the Tracking Script
  • Step 2: Implement Tracking Events
  • Troubleshooting
  1. FUNDAMENTALS
  2. Getting Started
  3. Integrations

Web tracker

PreviousIntegrationsNextApp Tracker

Last updated 3 months ago

Overview

The Website Tracker allows users to monitor and analyze website activity by integrating a tracking script into their web pages. This guide provides detailed steps for setting up the tracker and configuring essential tracking events to ensure seamless data synchronization.


Prerequisites

Before setting up the website tracker, ensure you have:

  • Access to your website's source code.

  • Permission to add scripts to the website.

  • A valid tracker script URL provided by your analytics provider.


Step 1: Integrate the Tracking Script

To enable website tracking, insert the provided JavaScript code before the closing </head> tag of your website.

Example Tracking Script:

// <script type="text/javascript">

 fetch("https://pndev.proemsportsanalytics.com/api/ccgt/tracker/web/")
      .then((response) => response.json())
      .then((data) => {
        const isTrackingEnabled = data.constants === 'p' ? true : false;
        if (isTrackingEnabled) {
          (function (p, l, o, w, i, n, g) {
            if (!p[i]) {
              p.GlobalSnowplowNamespace = p.GlobalSnowplowNamespace || [];
              p.GlobalSnowplowNamespace.push(i);
              p[i] = function () {
                (p[i].q = p[i].q || []).push(arguments);
              };
              p[i].q = p[i].q || [];
              n = l.createElement(o);
              g = l.getElementsByTagName(o)[0];
              n.async = 1;
              n.src = w;
              g.parentNode.insertBefore(n, g);
            }
          })(
            window,
            document,
            "script",
            "https://psa-sp.s3.ap-south-1.amazonaws.com/psa_tracker.js",
            "snowplow"
          );
          snowplow("environment", club-platform, "psa_sdk.proemsportsanalytics.com", {
            appId: "App-ID",
            platform: "web",
            contexts: {
              webPage: true,
              performanceTiming: true,
            },
          });
        }
      });
  </script>

Instructions:

  1. Copy the provided script.

  2. Paste it before the closing </head> tag on every page where tracking is required.

  3. Save and publish your website changes.

This script loads asynchronously, ensuring that website performance is not affected.


Step 2: Implement Tracking Events

After initializing the tracker, you must implement specific tracking events to monitor user activity.

Example Tracking Events:

snowplow('setUserId', "USER_ID");

snowplow("trackPageView");

Required Events:

  1. setUserId: Assigns a unique identifier to the user.

  • Replace USER_ID with the actual user ID from your system.

  • If no ID is available, pass null.

  1. trackPageView: Logs a page view event whenever a user navigates to a new page.

  • This function should be called on every page load.


Troubleshooting

  • Tracker not loading? Ensure the script is correctly placed before </body>.

  • Events not firing? Check for JavaScript errors in the browser console.

  • Incorrect user ID? Ensure setUserId is called with the correct value.

  • Slow performance? Confirm the tracker script is loading asynchronously.

Following these steps will ensure proper setup and accurate event tracking for your website.