Clicks statistics
Affiliate click analytics with local redirects and GA4 events
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 (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.

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.

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
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.
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:
<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
.

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.

Using Custom Parameters
Each cegg_affiliate_click
event includes additional parameters that help you identify where clicks came from and which products performed best.
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:
In GA4, go to Admin (⚙️ icon) → Data Display → Custom Definitions.
Click Create Custom Dimension.
Fill in:
Dimension Name: A descriptive name (e.g., Product Title)
Scope:
Event
Event Parameter: The exact parameter name (e.g.,
cegg_product_title
)

Wait 24–48 hours for new definitions to begin collecting data. These apply to new events only and will not retroactively affect past data.
Creating a GA4 Exploration Report
You can build a custom report to analyze affiliate clicks:
Go to Explore → Blank Exploration.
Add Dimensions such as:
Event name
Your custom definitions (e.g., Product Title, Module)
Add the Metric:
Event count
Under Rows, add the dimensions you want to display.
Under Values, include the event count.
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.

Last updated