Ad Impression and Click Tracking

Ad Inserter Pro supports ad impression and click tracking. This enables you to monitor how many times each ad was displayed and how many times it was clicked. In the case you are displaying two or more ad options (A/B testing) you can easily determine which ad option has the highest CTR (Click-Through Rate).

To use tracking you need to enable it globally (at the level of plugin), select click detection method (if available in your version), enable tracking for individual code blocks (ads) and then you have to clear page cache (if you are using caching). When enabled, Ad Inserter Pro adds tracking code to each page where ads are inserted.

Please make sure you have cleared all caches before making any tests otherwise tracking scripts will not be present on pages. Tracking code uses also nonce verification to prevent unauthorized submission of tracking data. If the verification fails, Ad Inserter Pro treats the tracking submission as spam. This can occasionally cause false-positives when using cache plugins. When an old cache file remains for longer than 24 hours, nonce verification will fail, and you’ll not be able to track impressions and clicks. To solve this problem, make sure you have the appropriate garbage collection (clean-up) settings in the cache plugin. The cache should be emptied frequently (less than 24 hours). The configuration varies in different cache plugins. Consult your cache plugin’s support for details.

Let's first clarify some terms.

Impressions

Impression is an event when code block (ad) is displayed. This is detected client-side in the browser with Javascript code after the page is loaded (assuming the Javascript is enabled in the browser). Therefore, impression tracking works also when the page is cached, but it doesn't work when Javascript is not enabled, Javascript is not running due to some error or the page was not loaded properly. For impression tracking to work, code block must have a wrapping div ("No wrapping" style can't be used).

Clicks

Click is an event when somebody clicks on the code block (ad). This is detected client-side in the browser with Javascript code (assuming the Javascript is enabled in the browser). Therefore, click tracking works also when the page is cached, but it doesn't work when Javascript is not enabled, Javascript is not running due to some error or the page was not loaded properly. For click tracking to work, code block must have a wrapping div ("No wrapping" style can't be used).

However, ads come in various forms and not all forms support reliable click tracking. In general, there are two types of ads: simple banners with links and Javascript based ads. Javascript based ads (e.g. AdSense) create <iframe> HTML element which is isolated from the main page and doesn't support click detection. However, with some advanced code it is possible to quite reliably "guess" when the user has clicked inside iframe ad. Therefore, Ad Inserter Pro supports two methods for click detection.

Standard Click Detection

This method can detect clicks on banners with links and is available in all versions of Ad Inserter Pro. An example of banner code where clicks can be reliably detected with standard click detection:

<a href="https://wordpress.org/plugins/ad-inserter/" target="_blank"><img src="https://ps.w.org/ad-inserter/assets/icon-256x256.jpg" /></a>

Advanced Click Detection

This method can detect clicks on any ad code but is not available in all versions of Ad Inserter Pro. Please note that impressions and clicks detected by Ad Inserter Pro might be differend from statistics of ad networks. This is mainly because the way how impressions and clicks are counted differs for each ad network and ad networks may not count some events (e.g. invalid clicks for AdSense). However, the method is reliable enough to get CTR in A/B tests and determine which ad gets more clicks.

PLEASE NOTE: if you install additional click trackers Ad Inserter Pro click tracking may not work. If you are using Ad Inserter Pro tracking make sure there are no other click trackers installed.

Tracking Settings

Tracking settings are available on the plugin settings tab (*).

ad inserter tracking settings

To globally enable tracking set Tracking to Internal. If you would like to test tracking and check statistics while you are logged in set Track Logged In Users to Enabled. Choose (if available) Internal Click Tracking Detection method according to the explanation above:

  • Standard click detection can detect clicks only on banners with links and is available in all versions of Ad Inserter Pro.
  • Advanced click detection can detect clicks on any ad code (including Javascript <iframe> ads) but is not available in all versions of Ad Inserter Pro.

If you are using only banners then choose Standard click detection as it is the most reliable method to detect clicks. Use Advanced method only if you need to detect clicks on AdSense, Amazon, Media Net or other Javascript based ads, for example, to run A/B test with AdSense and Amazon Native Shopping Ads to determine which ad has the highest CTR.

Clear All Statistics Data clears all impression and click data for all code blocks. Use it only when you need to delete all statistics.

Ad Tracking

To track individual code block (or ad) you need to enable tracking for this code block. Click on the tracking button and save settings.

ad inserter tracking enable

Once the tracking for the code block is enabled, Ad Inserter Pro will insert tracking code on the page where this ad is inserted and will track impressions and clicks on this ad. If you are using caching you need to clear cache before tracking can be used.

Tracking Statistics

To see impression and click statistics for this block click on the statistics button.

ad inserter tracking toggle

This button toggles code editor and statistics display.

ad inserter tracking statistics

Tracking statistics shows impressions, clicks and CTR for the selected range including average value for the last 30 days. You can select one of the predefined ranges (last month, this month, this year, last 15, last 30, last 90 last 180 or last 365 days) or select custom date range. The statistics data is kept for one year. When you select a predefined range the data is loaded automatically, for custom data range you need to click on the load button to load statistics data for this range.

ad inserter statistics load

Sometimes you might get error message when trying to load data. This is usually due to expired security token (the page has been loaded for a while). In such case simply reload Ad Inserter Pro settings page.

ad inserter statistics error

Ad Inserter Pro supports also live tracking - you can watch in real time how impressions, clicks and CTR change when visitors visit your website. For this you need to enable Auto Refresh function.

ad inserter statistics play

When this function is enabled Ad Inserter Pro will reload data every 60 seconds.

Sometimes you may want to clear statistics data for some date range. To do this select wanted date range and click on the clear button. All the statistics data for this block will be deleted and the charts will show no data for this date range.

ad inserter statistics clear

When tracking is globally or just for this block disabled, you may still analyze stored statistics data. In such case there will be a small yellow sign indicating disabled tracking.

ad inserter tracking disabled

A/B testing

When code block (or ad) has two or more versions (using |rotate| function), tracking statistics will show total data (impressions, clicks and CTR) and data for each version. This way you can easily determine which version gets more clicks.

ad inserter statistics versions

Please note that there might be some slight imbalance between version impressions. The |rotate| function randomly selects one ad on each page load so on long run you'll get almost equal number of impressions for each ad version. However, the CTR will always be accurate as it is the ratio of actual clicks and impressions.

No version label simply means that there are also impressions or clicks where there was only one ad version or version was not detected (due to some error on the page).

You can also get impression, click and CTR charts for individual ad versions. Click on Details button to toggle version charts.

ad inserter statistics version charts