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

# Track custom events with Google Tag Manager

> Install Google Tag Manager on your Cafe24 store and use it to send custom events to Notifly.

## 1. Install Google Tag Manager on your Cafe24 store

> [!NOTE]
>
> If your Cafe24 store already has Google Tag Manager (GTM), skip this section.

### 1-1. Create a GTM account

1. Open [Google Tag Manager](https://tagmanager.google.com/). In the upper-right corner, select **Create Account** and complete the setup. ![Create Account button in Google Tag Manager](https://mintcdn.com/notifly/umP8GQfcNYrXNUqj/ko/user-guide/images/user-guide/cafe24/ko/assets/images/gtm-create-account-25d91583432cb7f652ee51e0fe88f37b.png?fit=max\&auto=format\&n=umP8GQfcNYrXNUqj\&q=85\&s=c3abeb9974b7ec583257de509b14f012)
2. Copy the installation code that GTM displays when you create the account. ![GTM installation code](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-source-code.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=12a7bc25c7ed92b042dfcde9e9d66c57)
3. In Cafe24 EC Admin, go to **쇼핑몰 설정** (Store settings) > **기본 설정** (Basic settings) > **검색 엔진 최적화 (SEO)** > **고급 설정** (Advanced settings) > **코드 직접입력** (Enter code directly). Select **PC 쇼핑몰** (Desktop store) or **모바일 쇼핑몰** (Mobile store) for the storefront you are setting up. Paste the GTM script into **Head 영역** (Head). If GTM also provided a `<noscript>` snippet, paste it into **Body 영역** (Body). ![Paste the GTM installation code in Cafe24](https://mintcdn.com/notifly/DhnaXLaUPk9oQQlV/ko/user-guide/images/user-guide/cafe24/ko/assets/images/gtm-inject-script-240b48f88912da58ebd7d12133643c6f.png?fit=max\&auto=format\&n=DhnaXLaUPk9oQQlV\&q=85\&s=5df54cea7810c75ebcb02cf22d822cef)
4. Save the changes in Cafe24. Return to the GTM installation dialog. Enter your store URL and click **Test**. ![GTM installation test with a field for the store URL](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-verify-installation.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=13f4df05833a86e060946d9a317e6f0c)

## 2. Install the Notifly Cafe24 GTM template

1. Open the [Notifly Cafe24 template releases](https://github.com/notifly-tech/notifly-gtm-template/releases) and download the latest `template-cafe24-custom-event.tpl` file.

2. Select **Templates** in the left menu. Under **Tag Templates**, click **New** to open the template editor.

   ![New button in Tag Templates](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-import-1.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=23c63fa414c5ffb84214f4be8ca52db0)

3. In the template editor, open the `⋮` menu next to **Save** and select **Import**. Select the template file you downloaded.

   ![Import option in the template editor menu](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-import-2.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=1d3650173bbcd6fbdc3387ebc0022b01)

4. Click **Save** after the template loads. Check the lower-left corner for a confirmation.

   ![Confirmation that GTM created the template](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-import-3.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=efc4e62bf2923cb910f4bda208509652)

## 3. Use custom events

### 3-1. Create a custom tag

1. In GTM, select **Tags** in the sidebar.

2. Click **New** in the upper-right corner.

   ![Create a new tag](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-create-custom-tag-1.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=5a76d5b4f69bb3036e279db9c4f83ac1)

3. Under **Tag Configuration**, choose [**Notifly Cafe24 Custom Event**](#2-install-the-notifly-cafe24-gtm-template).

   ![Select the Notifly custom template for the tag](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-create-custom-tag-2.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=31d899c80729562505ce26b9820b7d62)

### 3-2. Example custom event

#### 3-2-1. Overview

Send a `search-icon-clicked` event to Notifly when someone clicks the search icon on your Cafe24 store.

![Search icon on the sample Cafe24 store](https://mintcdn.com/notifly/umP8GQfcNYrXNUqj/ko/user-guide/images/user-guide/cafe24/ko/assets/images/cafe24-sample-mall-screenshot-26e825e94259d3fb6fb9d77dfc1cadb9.png?fit=max\&auto=format\&n=umP8GQfcNYrXNUqj\&q=85\&s=a5f6634560bc81134d7ef853939ec408)

#### 3-2-2. Identify the search icon

A GTM trigger determines when a tag runs. To run the tag when a user clicks the search icon, first identify the element using a CSS selector.

1. In your browser, right-click the search icon and choose **Inspect**. The developer tools highlight the element's HTML.

![Search icon HTML highlighted in the browser developer tools](https://mintcdn.com/notifly/DhnaXLaUPk9oQQlV/ko/user-guide/images/user-guide/cafe24/ko/assets/images/search-icon-inspection-bd9401ab1184cb97d042294b3264536b.png?fit=max\&auto=format\&n=DhnaXLaUPk9oQQlV\&q=85\&s=de241e8b3d094de62473b6a55c3f1130)

2. Right-click the highlighted HTML and select **Copy** > **Copy selector**. Save the selector for the trigger setup. For example, the selector on the sample store is `#top_nav_box > div.top_mypage > a.eSearch > svg`.

![Copy selector option for the search icon's HTML](https://mintcdn.com/notifly/umP8GQfcNYrXNUqj/ko/user-guide/images/user-guide/cafe24/ko/assets/images/copy-css-selector-b610cca9c24d57ce9bd22e1272b64475.png?fit=max\&auto=format\&n=umP8GQfcNYrXNUqj\&q=85\&s=55b6522f824994097e26b89f730e4516)

#### 3-2-3. Create the trigger

1. In the tag from section 3-1, click **Triggering** below **Tag Configuration**.

2. Click **+** in the upper-right corner of the trigger picker. Click **Trigger Configuration**.

   ![Add a trigger to the tag](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-create-trigger-1.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=5996ea76721e6e24bc2ab6e8872ac26c)

3. For the trigger type, under **Click**, select **All Elements**, then select **Some Clicks**.

   ![Choose which click events trigger the tag](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-create-trigger-2.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=e6a5f8113a7e23c2cbc0a5d8283d81b8)

4. Set the variable to **Click Element** and the operator to **matches CSS selector**. Paste the selector you copied.

   ![Set the click condition using the CSS selector](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/gtm-create-trigger-3.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=6dc1c6052d0ea1bd0e98f4457b42e651)

   > [!TIP]
   >
   > If **Click Element** isn't listed, use the option at the bottom of the dropdown to add it as a built-in variable.

5. Click **Save**.

#### 3-2-4. Finish the tag

1. In the [custom tag](#3-1-create-a-custom-tag), enter `search-icon-clicked` in **이벤트 이름** (Event name). If you choose another name, look for that name when you test.

   ![Event name field containing search-icon-clicked](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/complete-tag-creation.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=6e7805d1d57328e60cabc3107eaf8869)

2. Click **Save** in the upper-right corner.

In the GTM workspace, click **Preview** and connect to your Cafe24 store. Click the search icon and confirm that Notifly receives the `search-icon-clicked` event.

To verify the event for your test user, open **User Management** > **User List** in the Notifly console. Select **유저 ID** (User ID), enter the test user's ID, and click **Search**. Open the user's details and look for the event under **일별 이벤트 발생 빈도** (Daily event counts).

![Custom event in the user's daily event counts](https://mintcdn.com/notifly/dcFO7QF5JScPffiH/images/i18n/en/cafe24/verify-event-tracking.png?fit=max\&auto=format\&n=dcFO7QF5JScPffiH\&q=85\&s=e5f532980c5347229dfe40c05dd1b099)

After testing, publish the GTM container to collect this event when visitors click the search icon on your live store.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.