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
  • Android Tracker Setup
  • iOS Tracker Setup
  • Troubleshooting
  1. FUNDAMENTALS
  2. Getting Started
  3. Integrations

App Tracker

Overview

The App Tracker enables users to monitor and analyze app activity by integrating a tracking SDK into their mobile applications. This guide provides detailed steps for setting up the tracker on both Android and iOS, configuring essential tracking events, and ensuring seamless data synchronization.


Android Tracker Setup

Prerequisites

Before setting up the Android tracker, ensure you have:

  • A valid tracker endpoint URL.

  • Access to your app's source code.

  • Permission to modify dependencies.

Step 1: Install the SDK

The Android Tracker SDK can be installed using Gradle. Add the following dependency in your build.gradle file:

dependencies {
    implementation 'com.snowplowanalytics:snowplow-android-tracker:5.+ '
}

Step 2: Initialize the Tracker

Once the tracker SDK is correctly set as a dependency, initialize it in your Application subclass:

val tracker = Snowplow.createTracker(
    applicationContext, "cggt-kotlin", "https://psa_sdk.promesportsanalytics.com"
)

val networkConfig = NetworkConfiguration(
    "https://psa_sdk.promesportsanalytics.com",
    HttpMethod.POST
)

val trackerConfig = TrackerConfiguration("cggt-android")
    .base64Encoding(false)
    .sessionContext(true)
    .platformContext(true)
    .lifecycleAutoTracking(false)
    .screenViewTracking(true)
    .applicationContext(true)
    .exceptionAutoTracking(true)
    .installAutoTracking(true)
    .userAnonymisation(false)

val sessionConfig = SessionConfiguration(
    TimeMeasure(30, TimeUnit.SECONDS),
    TimeMeasure(30, TimeUnit.SECONDS)
)

createTracker(
    applicationContext, "cggt-kotlin", networkConfig, trackerConfig, sessionConfig
)

Step 3: Verify the Tracker

To ensure that tracking is working correctly:

  1. Run your app in a debugger.

  2. Check logs for successful tracker initialization.

  3. Verify events are being sent to the tracker endpoint.


iOS Tracker Setup

Prerequisites

Before setting up the iOS tracker, ensure you have:

  • A valid tracker endpoint URL.

  • Access to your app's source code.

  • Permission to modify dependencies.

Step 1: Install the SDK

Using Swift Package Manager

In Xcode, go to File > Swift Packages > Add Package Dependency, and add the following URL:

https://github.com/snowplow/snowplow-ios-tracker

Using CocoaPods

If you are using CocoaPods, add this to your Podfile:

pod 'SnowplowTracker', '~> 5.0'

Then run:

pod install

Step 2: Initialize the Tracker

Set up the tracker in AppDelegate.swift:

class TrackerManager {
    static var tracker: TrackerController?
    
    static func initializeTracker() {
        guard let url = URL(string: "https://pndev.promesportsanalytics.com/api/cggt/tracker/ios/") else {
            print("Invalid URL")
            return
        }
        
        let task = URLSession.shared.dataTask(with: url) { data, response, error in
            guard let data = data else {
                print("No data received from API")
                return
            }
            
            if let rawResponse = String(data: data, encoding: .utf8) {
                print("Raw API Response: \(rawResponse)")
            }
            
            do {
                if let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
                    print("Parsed JSON Response: \(json)")
                    
                    if let enableTracker = json["enableTracker"] as? Bool {
                        print("Tracker enable status from API: \(enableTracker)")
                        
                        if enableTracker {
                            tracker = PSATracker.createTracker(
                                namespace: "cggt-swift",
                                endpoint: "https://psa_sdk.promesportsanalytics.com"
                            )
                        }
                    }
                }
            } catch {
                print("Failed to parse API response with error: \(error)")
            }
        }
        task.resume()
    }
}

Step 3: Verify the Tracker

To ensure tracking is working correctly:

  1. Run your app and check for console logs confirming tracker initialization.

  2. Use debugging tools to verify that tracking events are being sent.

  3. Confirm that data is being received in your analytics dashboard.


Troubleshooting

  • Tracker not initializing? Ensure the correct tracker URL is used.

  • Events not firing? Verify tracker setup in logs and confirm events are being triggered.

  • Incorrect user data? Check that the correct user ID is being passed.

  • Slow performance? Ensure the tracker loads asynchronously and does not block app execution.

By following these steps, you can successfully integrate and validate the app tracker on both Android and iOS platforms.

PreviousWeb trackerNextSetting up email service provider

Last updated 3 months ago