---
title: "Best practices on Product & Web data tracking"
slug: "best-practices-on-product-web-data-tracking"
updated: 2026-01-20T04:14:22Z
published: 2026-01-20T04:14:22Z
canonical: "help.madkudu.com/best-practices-on-product-web-data-tracking"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://help.madkudu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Best practices on Product & Web data tracking

Are you looking into **tracking your users' product activity** to get a better understanding of their behavior? Would you like to start sending product activity or web visits to HG Insights but you haven't implemented tracking yet? HG Insights doesn't collect data directly but it processes **product and web activity sent from Segment, Amplitude, Mixpanel, or your Data Warehouse**.

Here are **tips and best practices for implementing product & web visit tracking** with these tools before sending them to HG Insights.

Tracking tools usually works with **Identify** calls (i.e. who is the user) and **Track/Page/Event** calls (i.e. what has the user done). When these tools are connected to HG Insights, HG Insights will automatically pull both the Identify and Track/Page/Event.

## **In which situations is it recommended to track users' behaviors?**

You'll constantly be trying to identify users and track their activities. But the following situations are particularly important to detect:

- When a user first registers
- When a user logs in
- When a user updates their info (for example, they change or add a new address)
- When a user changes their pricing plan (purchase, upgrade, downgrade, cancel)

Learn more about the [the type of events that can be used in a HG Insights behavioral model](/v1/docs/what-type-of-events-can-be-used-in-a-behavioral-model).

## **Best practices for Identifying users**

After you've implemented Segment or Amplitude on your website or app, an Identify call is made to Segment or Amplitude. Essentially the website asks the tracking tool "who is this person?". The answer can be an anonymousID or a userID. Description attributes (also known as "**traits**" or "**user** **properties**") like email, name, plan, role, etc. can be passed in the identify call.

Example of an answer (payload) of an Identify call,

![](https://cdn.document360.io/a55e7ea5-b8ac-4456-874d-10cc92097370/Images/Documentation/image(224).png)

All the activities of that person will be associated with this anonymousID or userID.

## Track the email of your users in Identify calls

HG Insights reconciles a person's activity across your different systems (Salesforce, HubSpot, Marketo, Segment, Amplitude, etc.) via the **email.**Each system would have a different userID, contactID, etc. but the identity of a person is unified at the **email** level.

*Example: here in Amplitude, the email***[*margo.rey@madkudu.com*](mailto:margo.rey@madkudu.com)***has 3 different userIDs but thanks to the email we'll be able to reconcile all these user's activities to Margo.* ![](https://cdn.document360.io/a55e7ea5-b8ac-4456-874d-10cc92097370/Images/Documentation/image(225).png)

This is why a trait or user property that is **necessary to pass in your identify call** is **the** **user email.** Without it, HG Insights won't be able to reconcile all activities to this person when scoring it.

To be able to leverage product activities in your HG Insights behavioral models**, you must always track the user email in the Identify traits.**

## How to check if you're already tracking the user email in Identify calls?

### **In Amplitude**

- Connect to your Amplitude account in the "Data" environment: [data.amplitude.com](https://data.amplitude.com/)
- Navigate to **Properties** on the left navigation bar to access the list of user properties.
- Search for **email**
- Make sure the status is "**Live**" ![](https://cdn.document360.io/a55e7ea5-b8ac-4456-874d-10cc92097370/Images/Documentation/image(226).png)

### **In Segment**

- Connect to your Segment account segment.com.
- Navigate to **Sources** on the left navigation bar to access the different sites you're tracking.![](https://cdn.document360.io/a55e7ea5-b8ac-4456-874d-10cc92097370/Images/Documentation/image(227).png)
- Go to your website or app source. ![mceclip3.png](https://support.madkudu.com/hc/article_attachments/11234340688397)
- Click on the **Schema tab.**
- Search for the **email** trait.
- Make sure the trait is active and not blocked. ![](https://cdn.document360.io/a55e7ea5-b8ac-4456-874d-10cc92097370/Images/Documentation/image(228).png)

## If you're just installing Segment or Amplitude, here is how to start tracking the email

**Pre-requisite:******you have access to your website or app code.

- Follow
  - [Basic Segment Installation guide](https://segment.com/docs/getting-started/02-simple-install/)
  - or Amplitude installation instructions as displayed when creating a new source (Java SDK for front end)
- You should now **have installed Segment's or Amplitude's JavaScript tracking code snippet on your website** (i.e. copy-pasted into the HTML of your website by your web developer or added via Google Tag Manager) and checked if you are receiving data.
- **On pages where you make identify calls,******i.e. pages where a user can leave their email address (signup, login, gated content, contact us, etc.), you need to **add the trait "email".** This means the identify call present on your website or app pages code should now look like this:
  - **Segment**

```plaintext
analytics.identify(' {{user.id}} ',{
   email:'{{user.email}}'
});
```

where {{user.email}} is what you got from the login form and {{user.id}} is the ID of the user in your database.

- 
  - **Amplitude**

```plaintext
var identify = new amplitude.Identify().set('email', {{user.email}});
amplitude.getInstance().identify(identify);
```

- Once done, check that you are receiving the email as trait or user property following the instructions in the section above ("[How to check if you're already tracking the user email in Identify calls?") .](/v1/docs/best-practices-on-product-web-data-tracking)

## Anonymous users and identified users

HG Insights will **use any Segment or Amplitude event data generated by a known user with an email address**.

Example: A user is browsing your website anonymously during their first session. Then during their 2nd session, this user submits a demo request form dropping their email, this user will now be associated with an email. [If you have implemented Amplitude to be able to backfill data](https://www.docs.developers.amplitude.com/analytics/data-backfill-guide/#backfill-best-practices), then the email will be backfilled to the anonymous sessions. If not, **HG Insights will only use the events that are performed in your product or website when the user and their email are known.**

# **Going further on the topic: some resources 📚**

When implementing Segment, we**recommend browsing and reading these Segment resources:**

- 🎥 [Video - How to install Segment on your website via **Webflow**](https://www.youtube.com/watch?v=-qTL0_FzsfY.)
- 📚 [What is Segment](https://segment.com/docs/getting-started/)
- 📚 [Segment Implementation Guide](https://segment.com/docs/getting-started/implementation-guide/)
- 📚 [Best Practices for Identifying Users](https://segment.com/docs/connections/spec/best-practices-identify/)

When implementing Amplitude, you can check out**these Amplitude articles:**

- 📚 Amplitude Developer Center
  - [What is Amplitude?](https://www.docs.developers.amplitude.com/analytics/what-is-amplitude/)
  - [Identify API](https://www.docs.developers.amplitude.com/analytics/apis/identify-api/)
- 📚 [Amplitude Quick Start Guide – Amplitude](https://amplitude.com/docs/get-started/amplitude-quickstart) - a short implementation guide to Amplitude, including:
  - [Step 2: Identifying your users – Amplitude](https://help.amplitude.com/hc/en-us/articles/206404628-Step-2-Identifying-your-users)
  - [Step 3: Understand your users' activity – Amplitude](https://amplitude.com/docs/get-started/understand-user-activity)
- 📚 [Track unique users in Amplitude](https://help.amplitude.com/hc/en-us/articles/115003135607-Track-unique-users-in-Amplitude) - how the reconciliation of anonymous users to known users is done
