Collecting data with Trackers and Webhooks

  1. Home
  2. Docs
  3. Collecting data with Trackers and Webhooks
  4. Trackers – collecting data from your own applications
  5. Unity Tracker
  6. Initialization


Assuming you have completed the Unity Tracker Setup for your project, you are now ready to initialize the Unity Tracker.

Importing the library

Add the following using lines to the top of your .cs scripts to access the Tracker:

using SnowplowTracker; using SnowplowTracker.Emitters; using SnowplowTracker.Events;
Code language: CSS (css)

You should now be able to setup the Tracker!

Creating a tracker

To instantiate a Tracker in your code (can be global or local to the process being tracked) simply instantiate the Tracker interface with the following:

// Create Emitter and Tracker IEmitter e1 = new AsyncEmitter ("com.collector.acme") Tracker t1 = new Tracker(e1, "Namespace", "AppId"); // Start the Tracker t1.StartEventTracking();
Code language: JavaScript (javascript)

If you’d like to learn more about Snowplow BDP you can book a demo with our team, or if you’d prefer, you can try Snowplow technology for yourself quickly and easily.