# 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](https://ce-docs.keywordrush.com/features/affiliate-link-redirects) (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="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fg3Ent6THw7lWjQiOTPSp%2Fimage.png?alt=media&#x26;token=2b7dc45c-9194-478c-bd4a-317bbbaf3237" 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="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2FGQCOn7Sm3k9gFnisHp8E%2Fimage.png?alt=media&#x26;token=bc4eb838-f055-4a76-b886-2bbc537bbeaf" 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="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2FddSOarXkYwFc3XkGIdfs%2Fimage.png?alt=media&#x26;token=13b7267f-7fdf-4fa3-948e-1492e00af0a7" 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="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2FM5HetKOySDMdDGxqGbOk%2Fimage.png?alt=media&#x26;token=5e168d2f-9401-435f-aa61-900520ab9392" 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="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2FLO0nmgK3jzmBvfydO1B8%2Fimage.png?alt=media&#x26;token=79fbec40-9078-438f-be98-4684f817c35d" 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="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fv1gjlezfEa4XAS8h6QG1%2Fimage.png?alt=media&#x26;token=eea15b29-a110-4697-a98f-b75a76b0e76d" alt=""><figcaption></figcaption></figure>
