The track event is a versatile method for recording any actions your users take, along with descriptive properties about those actions. Each track event is identified by a name, such as “User Subscribe,” and can be enriched with properties like “billing plan” to provide context. These events are crucial for understanding user behavior, measuring the effectiveness of features, and optimizing the user experience.

Event fields

The track event collects several fields about the action:

FieldTypeDescription
nameStringThe name of the action
propertiesObjectFree-form dictionary of properties of the action

How to collect the track event?

The track event can only be collected manually by calling the edgee.track() method. Here’s a breakdown of how to structure a track call:

// Syntax: edgee.track(trackObj, destinations);
edgee.track({
    "name": "color choice",
    "properties": {
        "color": "blue",
        "category": "shoes",
        "label": "Blue Sneakers"
    }
}, {
    "Google Analytics": true,
    "Amplitude": true,
    "Facebook Conversions API": true
});

In this example, the track event captures a “color choice” event, detailing the item’s color, category, and label. Additionally, you can specify the analytics destinations where this event data should be sent. If the destinations parameter is not specified, Edgee will look at the Context Payload if destinations are specified. If not, the event will be sent to all your destinations.

The edgee.track() method expect one required parameter, and another optional:

fieldtypedescription
trackObjrequiredobject|stringA free-form dictionary object containing properties of the track event. This object has to include the name field, and can include the properties field. If a string is passed, it will be considered as the name field.
destinationsoptionalobjectSpecifies which analytics components should receive the event data. This allows for targeted data sending based on your configured components within the Edgee platform.

Privacy

The property field is designed for capturing any data you wish to collect.

If this field doesn’t contain personally identifiable information (PII), utilizing the track event is straightforward and secure without requiring user consent. This is because Edgee anonymizes any personal data before it’s transmitted to the destinations.

However, if PII is included in the property field, obtaining user consent prior to data collection is imperative. Additionally, your data collection methods must comply with GDPR, CCPA, and any other applicable data protection laws.

Best Practices for track Events

  • Descriptive Event Names: Use clear and descriptive names for your events to ensure that data is easily understandable and actionable.
  • Relevant Properties: Include properties that offer valuable insights into the event. Avoid overloading events with unnecessary data to maintain clarity.
  • Selective Destination Sending: Utilize the destinations parameter to fine-tune where your data is sent, optimizing for relevance and efficiency.
  • Privacy Considerations: Note that you must ensure that no personally identifiable information (PII) is sent throught the properties field