# How to Configure Custom Events

## How to Configure Custom Events

Log in to Experience and click "Data Management" >> "Get Tracking Tag" in the admin panel.

Enter the "Get Tracking Tag" screen, click "Event Measurement", and copy the event tag.

If you want to understand user behavior trends more accurately, add detailed information as event labels in the tracking tag. Modify the tag to include the information you want to measure, following the sample tag example. **Note:** **Event Label: 'value'** Event labels can be defined freely, and values contain instructions to retrieve data when the event is triggered. For more details on event labels, please refer to [this](/en/experience/setting/custom-event-setup.md) article.

```jsx
ptengine.track('check_out', {
event_label_1: 'value_1',
event_label_2: 'value_2'
});
```

Place the code from step 3 on the page where the event occurs. If you're using Google Tag Manager, please refer to [Setting up via Google Tag Manager](/en/experience/setting/custom-event-setup.md).

If pasting directly, place it before .

## **Configuration Examples**

**Example 1: When measuring user behavior as an event when clicking the "Login" button**

**Sample Tag 1 (HTML):**

```jsx
<button onclick="ptengine.track('event_name')">Login</button>
```

**Sample Tag 2 (JavaScript):**

```jsx
document.getElementById('btnLogin').addEventListener('click', function (){
ptengine.track('event_name');
});
```

**Example 2: When measuring user behavior as an event when clicking the "Submit" button, and measuring email address and registration date**

**Sample Tag 1 (HTML):**

```html
<button id="btnSubmit"
    onclick="ptengine.track('event_name', {
	    email: document.getElementById('email').value, 
	    submit_date: new Date()
    });">
submit</button>

```

**Sample Tag 2 (JavaScript):**

```jsx
    document.getElementById('btnSubmit').addEventListener('click', function() {
        ptengine.track('event_name', {
            email: document.getElementById('email').value,
            submit_date: new Date()
        });
    });

```

> **WARNING** Configuring the tracking tag involves modifying your site's HTML source code. Please have a technical person set this up, or feel free to contact us via chat if you need our support.

After configuration is complete, you can check the detailed information of events in the "Data Management" screen.

You can also add descriptions by clicking the "..." edit button in the "Event" or "Event Label" features.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helps.ptengine.com/en/experience/setting/custom-event-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
