# Clicks statistics

Content Egg can record click statistics for affiliate links in two ways: with local redirects and without redirects. You can analyze results on a dedicated dashboard and (optionally) send GA4 events.

### 1. Track Clicks With Redirect

Enable at: **Content Egg → Settings → General → Track Clicks With Redirect** (enabled by default).

Clicks are counted for modules that have [Link Cloaking](/features/affiliate-link-redirects.md) (local redirects) enabled in their module settings.

Notes:

* Known bots are filtered by user-agent to reduce noise.
* After enabling cloaking, the plugin indexes existing product links in the background. On large sites this may take a few minutes.
* You can adjust **Clicks Retention** (days) in settings.

### 2. Track Clicks Without Redirect

Some programs (e.g. Amazon) don’t allow link cloaking. For those modules, enable:

**Content Egg → Settings → General → Track Clicks Without Redirect** (disabled by default).

* Links remain direct.
* A lightweight JS beacon sends click events for counting.

<figure><img src="/files/nvzZ5ayVKtGJof4ohpc0" alt=""><figcaption></figcaption></figure>

### 3. Statistics Dashboard

Go to **Content Egg → Clicks Statistics** to review:

* Date range & module filters, plus comparisons with the previous period.
* Top posts and top products by clicks to focus optimization efforts.
* Zero-click posts/products to identify content that may need updates or pruning.
* Share of clicks by module for the selected range.

<figure><img src="/files/CsMCcKtLGM4jcmlms9xl" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Tip:** Regularly review pages with zero clicks. Rewriting or removing “dead” pages can improve SEO and user engagement.
{% endhint %}

### **4. Tracking Clicks in Google Analytics (GA4)**

You can integrate Content Egg’s click events with Google Analytics 4 (GA4) to gain deeper insights into how users interact with your affiliate links.

#### **Requirements**

{% hint style="warning" %}
GA4 must be installed on your website before enabling this feature.\
You can install it using the **Site Kit by Google** plugin or any other preferred GA4 integration method.
{% endhint %}

#### **Enabling GA4 Link Tracking**

Go to:\
**Content Egg → Settings → General → GA4 Link Tracking.** Set **GA4 Link Tracking = Enabled**.

Once enabled, Content Egg will automatically send **`cegg_affiliate_click`** events to GA4 whenever users click your affiliate links.

Here’s an example of how the event code looks in your link:

```html
<a rel="nofollow"
   onclick="gtag('event', 'cegg_affiliate_click', {
     'cegg_product_title': 'Round Pottery Drape Form for Plates',
     'cegg_module': 'AE__etsy',
     'cegg_unique_id': '753aa4ae6c3808728f252d6dcd3339ff',
     'cegg_post_id': 1824
   });"
   target="_blank"
   href="https://example.com/recommend/round-pottery-drape-form-for-plates-b43676/"
>
  View Price at Etsy.com
</a>
```

When a user clicks the link, the event is sent to GA4 in real time.

#### **Testing Events**

To verify the setup:

* Open **GA4 → Realtime → Events**.
* Look for the event name **`cegg_affiliate_click`**.

<figure><img src="/files/NivFoUTgphXOWKR6ZtiJ" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Note:** Many GA4 plugins exclude admin users from tracking.\
To test properly, open your site in an **incognito window** or temporarily disable the exclusion setting in your analytics plugin.
{% endhint %}

<figure><img src="/files/FLDosFqcKBqJsPr46q2u" alt="" width="375"><figcaption></figcaption></figure>

#### **Using Custom Parameters**

Each `cegg_affiliate_click` event includes additional parameters that help you identify where clicks came from and which products performed best.

| Parameter            | Description                          |
| -------------------- | ------------------------------------ |
| `cegg_product_title` | The affiliate product’s title        |
| `cegg_module`        | Module ID (e.g., AE\_\_etsy, Amazon) |
| `cegg_unique_id`     | Unique product ID                    |
| `cegg_post_id`       | Post ID where the link appears       |

To use these parameters as dimensions in GA4 reports, you need to register them as **Custom Definitions**.

**Steps:**

1. In GA4, go to **Admin (⚙️ icon) → Data Display → Custom Definitions**.
2. Click **Create Custom Dimension**.
3. Fill in:
   * **Dimension Name:** A descriptive name (e.g., Product Title)
   * **Scope:** `Event`
   * **Event Parameter:** The exact parameter name (e.g., `cegg_product_title`)

<figure><img src="/files/b0kuYakYgwwZvGqXTjwo" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Wait 24–48 hours** for new definitions to begin collecting data.\
These apply to **new events only** and will not retroactively affect past data.
{% endhint %}

#### **Creating a GA4 Exploration Report**

You can build a custom report to analyze affiliate clicks:

1. Go to **Explore → Blank Exploration**.
2. Add **Dimensions** such as:
   * `Event name`
   * Your custom definitions (e.g., Product Title, Module)
3. Add the **Metric:** `Event count`
4. Under **Rows**, add the dimensions you want to display.
5. Under **Values**, include the event count.
6. Apply a **Filter**:
   * Choose `Event name`
   * Set condition to **“Exactly matches”**
   * Enter: `cegg_affiliate_click`

You’ll now see how many times each product was clicked.

To view which pages generate the most clicks, add the **Page path** dimension.\
You can also export your report to **Google Sheets** for easier visualization and comparison.

<figure><img src="/files/M1ydRaEF3vlZp0IliUIk" alt=""><figcaption></figcaption></figure>


---

# 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://ce-docs.keywordrush.com/features/clicks-statistics.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.
