by john on November 29, 2003

After some gentle prodding I’ve decided to release MTAdSenseStats after all. Please read my previous entry to understand why I have hesitated in releasing it. It is important to note that using these tags on a public website is a violation of Google’s Terms & Conditions and I take no responsibility for anything that may happen if you use this plugin. The use of MTAdSenseStats should be restricted solely to private pages strictly for the use of the AdSense account holder.

<DISCLAIMER>I barely know Perl, I’ve never coded a Movable Type plugin before and I’m a manager. Proceed at your own risk.</DISCLAIMER>

With that said, I present MTAdSenseStats, a Movable Type plugin designed for the private use of AdSense account holders who wish to incorporate some AdSense statistics in private pages within a Movable Type weblog.

To use simply and place in your Movable Type plugins directory. Replace the username and password in the file with your own AdSense account information. Then use any of the available tags in your templates.

MTAdSenseStats includes the following tags:

MTAdSenseStats – Container tag
MTAdSenseStatsVersion – Version number of MTAdSenseStats
MTAdSenseStatsDays – Number of days in the AdSense program
MTAdSenseStatsDateToday – Date for the “today” stats
MTAdSenseStatsImpressionsTotal – Total impressions to date
MTAdSenseStatsImpressionsPerDay – Average impressions per day
MTAdSenseStatsImpressionsToday – Total impressions for today
MTAdSenseStatsImpressionsMin – Fewest impressions for one day over history
MTAdSenseStatsImpressionsMinDate – Date of fewest impressions
MTAdSenseStatsImpressionsMax – Most impressions for one day over history
MTAdSenseStatsImpressionsMaxDate – Date of most impressions
MTAdSenseStatsClicksTotal – Total clicks to date
MTAdSenseStatsClicksPerDay – Average clicks per day
MTAdSenseStatsClicksToday – Clicks for today
MTAdSenseStatsClicksMin – Fewest clicks for one day over history
MTAdSenseStatsClicksMinDate – Date of fewest clicks
MTAdSenseStatsClicksMax – Most clicks for one day over history
MTAdSenseStatsClicksMaxDate – Date of most clicks
MTAdSenseStatsCtrTotal – Clickthrough rate to date
MTAdSenseStatsCtrToday – Clickthrough rate for today
MTAdSenseStatsCtrMin – Lowest clickthrough rate for one day over history
MTAdSenseStatsCtrMinDate – Date of lowest clickthrough rate
MTAdSenseStatsCtrMax – Highest clickthrough rate for one day over history
MTAdSenseStatsCtrMaxDate – Date of highest clickthrough rate
MTAdSenseStatsEarningsTotal – Total earnings to date
MTAdSenseStatsEarningsPerDay – Average earnings per day
MTAdSenseStatsEarningsToday – Total earnings for today
MTAdSenseStatsEarningsMin – Least earnings for one day over history
MTAdSenseStatsEarningsMinDate – Date of least earnings
MTAdSenseStatsEarningsMax – Most earnings for one day over history
MTAdSenseStatsEarningsMaxDate – Date of most earnings

Here is how it might be used in a template:

AdSense Statistics (MTAdSenseStats v<$MTAdSenseStatsVersion$>) for <$MTAdSenseStatsDateToday$>:
Today’s impressions: <$MTAdSenseStatsImpressionsToday$>
Today’s clicks: <$MTAdSenseStatsClicksToday$>
Today’s ctr: <$MTAdSenseStatsCtrToday$>
Today’s earnings: <$MTAdSenseStatsEarningsToday$>
Total stats over <$MTAdSenseStatsDays$> days:
Average impressions: <$MTAdSenseStatsImpressionsPerDay$>
Average clicks: <$MTAdSenseStatsClicksPerDay$>
Average earnings: <$MTAdSenseStatsEarningsPerDay$>
Total impressions: <$MTAdSenseStatsImpressionsTotal$>
Total clicks: <$MTAdSenseStatsClicksTotal$>
Total ctr: <$MTAdSenseStatsCtrTotal$>
Total earnings: <$MTAdSenseStatsEarningsTotal$>
Minimum impressions of <$MTAdSenseStatsImpressionsMin$> on <$MTAdSenseStatsImpressionsMinDate$>
Maximum impressions of <$MTAdSenseStatsImpressionsMax$> on <$MTAdSenseStatsImpressionsMaxDate$>
Minimum clicks of <$MTAdSenseStatsClicksMin$> on <$MTAdSenseStatsClicksMinDate$>
Maximum clicks of <$MTAdSenseStatsClicksMax$> on <$MTAdSenseStatsClicksMaxDate$>
Minimum clickthrough of <$MTAdSenseStatsCtrMin$> on <$MTAdSenseStatsCtrMinDate$>
Maximum clickthrough of <$MTAdSenseStatsCtrMax$> on <$MTAdSenseStatsCtrMaxDate$>
Minimum earnings of <$MTAdSenseStatsEarningsMin$> on <$MTAdSenseStatsEarningsMinDate$>
Maximum earnings of <$MTAdSenseStatsEarningsMax$> on <$MTAdSenseStatsEarningsMaxDate$>

I hope you find it useful. I’d also love to get suggestions for improvement, there should be many.

[NOTE – Because AdSense uses https you need either IO:Socket:SSL or Crypt:SSLeay installed]

Should you really need to maximize your Adsense Earnings don’t forget to read my article on using Adsense Channels to maximize per post revenue.

11/29/2003 – Version .25 released.


MT Plugin Directory December 1, 2003 at 6:52 pm


The use of MTAdSenseStats should be restricted solely to private pages strictly for the use of the AdSense account holder….

Technically Speaking December 1, 2003 at 11:04 pm

Letter of the day, M

M is for maleficent, malevolent, malicious, malignant Monday M is for misfortune, miasma, miserable moment M is for marvelous, magnanimous mechanism M is for mischief, malpractice, maltreatment, misconduct, mishandling, muckraking M is for mercurial, m…

Technically Speaking February 6, 2004 at 10:08 pm

Making more progress…

Okay, I finally got a plugin working that I have been messing with for months now, off and on. AdSenseStats is working and I must say that it will be a great tool for me to check my info. I still stand behind my assertion that MT Plugin Manager doesn’t…

john March 21, 2004 at 6:05 am

MTAdsenseStats is currently broken as Google made some cool new changes to AdSense which of course hosed my plugin u Hoping to get it fixed soon.

Olivier RAveau - Le grand frre des 2 Bro'S du Site du February 13, 2006 at 4:26 pm

Hello John,

Could you give your Plugin in .txt format.
Because now it’s on .PL and here is what I get : ”
The server encountered an internal error or
misconfiguration and was unable to complete
your request.
Please contact the server administrator, and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.
Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.”

Thank You…
I can’t bear waitin’ for it ….. 😉

Previous post:

Next post: