Skip to main content
After the basic script is running, the next step is “tagging”. This allows you to capture user interactions like button clicks, form submissions, or purchases that cannot be tracked automatically.
Basic Rules
  • Character Limit: Event names are limited to 50 characters.
  • Name Required: Events cannot be sent without a name.

Understand Event Types

We distinguish between two types of events:

Property-Type Events

Simple Tracking. Sends only the name of the action.Example: “Button clicked”, “Menu opened”.

Payload Events

Advanced Tracking. Sends the name plus additional data (context).Example: “Product added to cart” (incl. product name, price, category).
Critical Privacy Notice bchic is designed to work completely without personally identifiable information (PII).Never use the following data in your events:
  • Email addresses
  • Names or usernames
  • Phone numbers
  • IP addresses
  • User IDs (in plain text)
Allowed are: Product IDs, categories, prices, generic status messages (e.g., “Plan: Pro”).

Method 1: HTML Attributes (No-Code)

This is the easiest method. You simply add attributes to your HTML elements – our script handles the rest automatically.
1

Choose Event Type

Decide if you just want to know IF something happened (Property), or WHAT exactly happened (Payload).
2

Add Attributes

Add the data-bchic-event attribute to the HTML element.
Syntax: data-bchic-event="NAME"
<!-- Before -->
<button class="btn">Download</button>

<!-- After -->
<button class="btn" data-bchic-event="whitepaper-download">
    Download
</button>
3

Test

Click on the element and check your bchic Dashboard. The event should appear immediately. If not, reload the dashboard once.

Method 2: JavaScript (For Developers)

For full flexibility or dynamic applications, use the function call bchic(). This method is ideal if you have data from an API or data types (numbers, booleans) are important.
const button = document.getElementById('signup-button');

button.addEventListener('click', () => {
// Sends only the name
bchic('track', 'signup_click');
});

Best Practices

To keep your data clean, we recommend the following conventions:
Use Kebab-Case:
  • newsletter-signup
  • Newsletter Signup
Be Specific:
  • pricing-cta-click
  • click
Consistency: Do not use signup on Page A and register on Page B for the same action.
Before implementing an event, ask yourself the following questions:
  1. Is an email address in the payload? ❌ (Forbidden)
  2. Is a User ID included? ❌ (Only allowed hashed or as internal ID)
  3. Is the data general enough? ✅ (e.g., product category instead of username)