# Tags

Tags define the **actions that will take place** on your website or application when certain conditions are met. While triggers specify when something should happen, tags specify what happens (e.g., log an event, update a profile, execute custom code).

{% hint style="info" %}

### Tag Lifecycle

1. **Definition** – A tag is created with a name, type, and optional advanced settings.
2. **Attachment** – The tag is linked to one or more triggers that define when it should execute.
3. **Execution** – When the trigger fires, the tag action runs (e.g., log event, update profile, show widget, execute code).
   {% endhint %}

### Step 1: Open the Tags Tab

From your **Workspace**, select **Tags** in the left-hand menu.

You will see a list of existing tags with the following details:

* **Name** – the tag’s unique identifier.
* **Type** – the action performed (Event, User, Widget, Custom HTML).
* **Triggers** – conditions that cause the tag to fire.
* **Last Edited** – when the tag was last modified.
* **Actions** – edit, view, or delete options.

<figure><img src="https://1642824329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX6uilbEAw42gqsudlclY%2Fuploads%2Fzf9C6hHBjAx5eehdIDjX%2FScreenshot%202025-09-23%20at%2013.14.41.png?alt=media&#x26;token=4145f74c-1086-447f-8094-3d71d58bf73d" alt=""><figcaption></figcaption></figure>

### Step 2: Create a New Tag

1. Click **Create Tag**.
2. Enter a **Name** for your tag (choose something descriptive, like *Purchase Event Web* or *User Profile Update*).
3. Select a **Type** from the dropdown menu. You can choose from:
   * **Netmera Event** – logs a user action or state.
   * **Netmera User** – updates or enriches profile attributes.
   * **Widget** – connects to an existing widget with advanced trigger options.
   * **Custom HTML** – inserts JavaScript or HTML for custom logic.

<figure><img src="https://1642824329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX6uilbEAw42gqsudlclY%2Fuploads%2FBP0w2dvKK8o6ZcwT85XR%2FScreenshot%202025-09-23%20at%2013.15.08.png?alt=media&#x26;token=e77fea6c-f005-404a-b16e-25565a997f83" alt=""><figcaption></figcaption></figure>

### Tag Types

#### Netmera Event

A **Netmera Event tag** is used to log a specific user action or state into Netmera.

These events appear in the **Netmera Panel** under **Reports** and can be used for:

* Segmentation (e.g., users who completed a purchase in the last 7 days).
* Journeys (e.g., trigger a follow-up campaign when a form submission occurs).
* Conversion and funnel analysis (e.g., add-to-cart → purchase rate).

**Example use cases**:

* Fire a `Purchase Event Web` whenever a payment confirmation page loads.
* Fire a `Screen View` event on every page to track user navigation.
* Fire a `Form Submission` event when a newsletter subscription form is submitted.

**Best for:** Marketers and product managers who want measurable user interactions without requiring developer changes.

<figure><img src="https://1642824329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX6uilbEAw42gqsudlclY%2Fuploads%2FA99cGmyTZGplnuFiEF5b%2FScreenshot%202025-09-22%20at%2013.18.38.png?alt=media&#x26;token=e512e825-3df7-4e3d-bf31-ee0fdbf5f795" alt=""><figcaption></figcaption></figure>

#### Netmera User

A **Netmera User tag** updates or enriches **user profile attributes**.

* This ensures that anonymous actions can be tied to user information once known.
* Attributes like `name`, `gender`, `msisdn`, `email`, `birthday`, or custom profile fields can be updated dynamically.

**Example use cases**:

* After login, fire a tag that updates the user’s `userId` and `email`.
* On a checkout page, capture the `msisdn` (phone number) of the buyer.
* When a user submits a profile update form, sync the data directly to Netmera.

**Best for:** Maintaining **clean, enriched user profiles** that support personalized targeting, segmentation, and reporting.

<figure><img src="https://1642824329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX6uilbEAw42gqsudlclY%2Fuploads%2FViZXzfUD5fseaf4VpdGL%2FScreenshot%202025-09-22%20at%2013.20.35.png?alt=media&#x26;token=00f6d958-7c15-4825-b08e-62e627400548" alt=""><figcaption></figcaption></figure>

#### Widget

A **Widget tag** connects with an existing Netmera widget (such as banners, pop-ups, surveys, subscription forms, or promotional flows).

{% hint style="info" %}
While widgets already include built-in tracking for impressions, clicks, and conversions, a Widget tag is useful when you need to define **more advanced or customized trigger logic**.
{% endhint %}

**Example use cases:**

* Apply complex conditions to determine when a widget interaction should fire.
* Combine widget engagement with other rules (e.g., page URL, user profile attributes).
* Extend scenarios where the standard widget setup does not fully meet requirements.

**Best for**: Businesses that already use widgets for engagement but want to set up **customized or advanced triggers** that cannot be achieved with the standard widget configuration.

<figure><img src="https://1642824329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX6uilbEAw42gqsudlclY%2Fuploads%2FhHeIuSzMhsOfP9Vl39i5%2FScreenshot%202025-09-22%20at%2013.21.25.png?alt=media&#x26;token=9e98a182-72bf-40a7-aa40-1bf7f386bb79" alt=""><figcaption></figcaption></figure>

#### Custom HTML

The **Custom HTML Tag** type allows you to insert your own **JavaScript or HTML code** directly into the site via Tag Manager.

**Example use cases**:

* Add a script that modifies the page layout.
* Show a custom banner or message.
* Run a JavaScript function when a specific trigger occurs.

**Important considerations**:

* Custom HTML is powerful but should be used carefully to avoid performance, duplication, or security issues. Always test in **Preview** before publishing.

**Best for:** Developers or advanced marketers integrating third-party tracking or building tailored scripts.

<figure><img src="https://1642824329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX6uilbEAw42gqsudlclY%2Fuploads%2FqD7xT8rnDnu2Rbe1PO4h%2FScreenshot%202025-09-22%20at%2013.21.55.png?alt=media&#x26;token=a8349ae2-d309-4840-93be-413ae54552fa" alt=""><figcaption></figcaption></figure>

### Step 3: Configure Advanced Settings (Optional)

1. In the tag editor, expand **Advanced Settings**.
2. Configure:
   * **Tag Sequencing** – ensure this tag runs before or after another.
   * **Tag Firing Priority** – set priority when multiple tags fire simultaneously.
   * **Tag Firing Option** – choose frequency (once per page, once per load, unlimited).
   * **Tag Firing Schedule** – restrict firing to certain dates or times.

<figure><img src="https://1642824329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX6uilbEAw42gqsudlclY%2Fuploads%2FXZlH3eAyuyTrQc54WanG%2FScreenshot%202025-09-22%20at%2015.26.47.png?alt=media&#x26;token=489417c8-5bc7-4327-8626-08a8588eb999" alt=""><figcaption></figcaption></figure>

#### Example Tags

The following examples illustrate how tags appear in the workspace:

| Name                          | Type          | Attached Triggers | Example Use Case                                |
| ----------------------------- | ------------- | ----------------- | ----------------------------------------------- |
| **Web Page View**             | Netmera Event | All Pages         | Fires on every page view for session analytics  |
| **Screen View**               | Netmera Event | All Pages         | Tracks mobile-like screen navigation events     |
| **Purchase Event Web**        | Netmera Event | All Pages         | Logs purchase events for revenue reporting      |
| **Fire Event For Every Page** | Netmera Event | All Pages         | General event collection on all pages           |
| **Show Custom HTML**          | Custom HTML   | Banner Shown      | Executes a custom script when a banner is shown |

### Step 4: Save and Attach Triggers

Every tag must have at least one trigger assigned. Without a trigger, a tag will never fire. By combining different tag types with trigger logic, you can track user actions, enrich profiles, display widgets, or insert custom code.

{% hint style="info" %}

#### Tag Triggers

* A **Trigger** is attached to one or more tags.
* When the trigger condition is met, all associated tags are executed.
* Multiple triggers can be added to the same tag for advanced conditions.
  {% endhint %}

1. While creating or editing a tag, go to the **Trigger** tab.
2. Click **Add new Trigger**.
3. Choose from an existing trigger in the dropdown, or:
   * **Edit this trigger**: Modify its properties.
   * **Create new trigger**: Build a completely new condition.
4. Once selected, the trigger will appear under the tag with its **Type** clearly displayed.
5. Save your configuration with **Save & Return to Workspace**.
6. Click **Save & Continue** after defining the tag.

<figure><img src="https://1642824329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX6uilbEAw42gqsudlclY%2Fuploads%2F7tYHFh2OycREjThjVTe7%2FScreenshot%202025-09-22%20at%2013.27.14.png?alt=media&#x26;token=ab420f75-6fb8-41bf-8167-22aaae4aa12f" alt=""><figcaption></figcaption></figure>
