LogoLogo
Support
Product Discovery Developer Guide
Product Discovery Developer Guide
  • Product Discovery Developer Guide
  • 🛒Item catalog management
    • What is the Items API?
    • How to work with Items
      • Item Schema
        • Attributes
        • Nested Item Schemas
        • Using the Item Schema API
        • DefaultLocale API
        • Onboarding on/migrating to Fredhopper
        • List of Reserved Attributes
      • Category Tree
        • Using the Category Tree API
        • Onboarding on XO
      • Item Catalog
        • Using the Catalog API
      • Items
        • Using the streaming Items API
        • Using the batch Items API
    • Step by Step guide
      • Step by step guide for Fredhopper customers
    • Feedback
      • Using the Feedback API
    • Authorization to APIs
    • Troubleshooting API errors
  • 🎯XO Recommendations
    • Introduction
    • Using the Recommendations API
    • Setting up the Chrome extension
    • Micro-segmentation
    • XO Legacy APIs
  • 🔎XO Search
    • Introduction
    • Getting started
    • API Reference
      • Search API
      • Autocomplete API (Beta)
      • Product Suggest API
    • API Parameters
      • Search
      • Pagination
      • Faceting
      • Sorting
      • Grouping
      • Filtering
      • Disable features
      • Response mask
      • Context
    • Configuration limitation
  • 🧪A/B testing
    • Fredhopper A/B testing
      • Integration steps for a non-caching solution
      • Integration steps for a caching solution
        • Java SDK Integration
          • Setup
          • Retrieve running A/B tests - Java SDK
          • Filter and request variant - Java SDK
          • Extending the SDK
        • Manual A/B tests integration
          • Retrieve running A/B tests
          • Filter out irrelevant A/B tests
          • Assign variants to user
          • Request variant for page
        • Limitations and Best Practices
  • 📚Resources
    • Glossary
    • Best Practices
      • Tracker Best Practices
      • Items API Best Practices
      • Fredhopper Data Configuration Best Practices
      • Fredhopper Query Response Best Practices
      • Fredhopper Merchandising Studio Best Practices
    • Privacy Notice
  • Archived Pages
    • FHR Tracking plan
    • XO Tracking plan
    • The Tracking API and JS Library
      • What to Track
        • Generic Actions
          • View
          • Click
          • Add to Cart
          • Remove from Cart
          • Purchase
        • Custom Actions
      • Initializing the JavaScript Library
      • REST API Technical Documentation
Powered by GitBook

Copyright @ 2024 Crownpeak Technology, Inc. All rights reserved.

On this page
  • Send all relevant activities
  • Include as much information as possible
  • Always include the source id if available
  • Store and keep sending the session id
  • Send and update users identities on log in/log out
  1. Resources
  2. Best Practices

Tracker Best Practices

Send all relevant activities

Whenever a user performs an action on your website that falls within the list of supported actions, you should send an activity. While in theory you may choose to send only some actions, not sending all actions can result in incomplete or wrong analytics.

Include as much information as possible

The metadata of the activity object can contain a lot of context information which can later be used to improve analytics such as adding a metadata.orderId property with the id of the order, so we can group purchased items into orders.

Adding the segments property to the activity object allows for analytics based on different tags such mobile vs desktop, or Chrome vs Safari.

Adding information around the user through the user.traits and user.segments properties, allows for analytics on users behavior based on groups they fall into.

Always include the source id if available

The activity object contains the sourceId field, however the field is not mandatory as it's not necessary for every type of action. However, this doesn't mean that you should omit it. The source id should always be added to the activity object when it is available.

You can check when you can omit it in the action specific pages.

Store and keep sending the session id

As soon as a user lands on your website, a session id will be generated for the user. This can be done automatically via the library, or by you.

The idea is that on their next connection, we will still have their session id to identify them and use for analytics.

If you handle it yourself, you need to store it in a cookie or some equivalent storage.

If you use the library, it will be stored in local storage on their browser.

Send and update users identities on log in/log out

If the user logs in you should add their logged in id that you have in your system (such as an ecommerce id) and start sending it over. While you can also only keep using the anonymous session id, it is advised that you also send over the known logged in id so user behavior can be tracked across multiple devices.

If the user logs out you should clear the logged in id and no longer send it.

More on identities below.

PreviousBest PracticesNextItems API Best Practices

Last updated 7 months ago

📚