Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-09-15 23:02:05

LeeStewart
Archived Plugin Author
From: Boston, MA, US
Registered: 2005-07-25
Posts: 81
Website

hit_logger plugins alpha v0.9.05 now available!

As promised, a new release of my hit tracking plugins!

Testers, I’d like for you to keep an eye on the “message” section of the pages (the line under the Textpattern logo) and see if there are any warnings. Also anything that’s printed above the Textpattern logo is a bug! I should be capturing all errors/warnings and displaying them properly.

New in This Release

  • There are a ton of internal changes, awaiting the next phase of coding. I also fixed a handful of bugs and tweaked things – speed and visual enhancements all over.
  • Added a bar chart to show the past two seeks of hits. Still planned – a month to month chart and something that displays the past year.
  • The basic and conditional tags are now in place! More tags are planned (see below).

Feel free to try something like this on the section that’s handling your 404s (go to “extensions:logger prefs” and specify the appropriate value for log_default_404_url):
<pre>
&lt;txp:hit_logger_if_404&gt; &lt;txp:hit_logger_if_search&gt; &lt;txp:hit_logger_search_engine /&gt; : &lt;txp:hit_logger_search_phrase /&gt; &lt;p&gt;Sorry, the page you were looking for wasn’t found. Here’s some pages that might be close to what you were searching for.&lt;/p&gt; &lt;txp:else /&gt; &lt;p&gt;Sorry that the page that you were looking for couldn’t be found. Feel free to poke around and see if you can find what you were looking for.&lt;/p&gt; &lt;p&gt;You might also tell &lt;txp:hit_logger_referring_host /&gt; to fix the link to this site (from page &lt;txp:hit_logger_referring_uri /&gt;).&lt;/p&gt; &lt;/txp:hit_logger_if_search&gt;
&lt;/txp:hit_logger_if_404&gt;
</pre>

Note: If the user performs a Google search and encounters a 404 on your site, the system automatically reuses the search string to find matching articles in Textpattern!

Full Tag List

  • txp:hit_logger_browser – shows the name of the browser that is currently viewing the page.
  • txp:hit_logger_os – display the name of the OS that the viewer is running.
  • txp:hit_logger_remote – shows the name of the person that visit your site. if that’s not available, shows name of the system they’re viewing from. If that fails as well, displays the IP address.
  • txp:hit_logger_search_phrase – output the search phrase (if any) that brought the user to the page. Note that this might not be the full search string – short words are removed and the remaining words are alphabetized.
  • txp:hit_logger_search_engine – display the name of the search engine that brought the user to this page.
  • txp:hit_logger_referring_host – the website that linked to this page.
  • txp:hit_logger_referring_uri – the page on the website that is linked to this page.

There are some conditional tags as well. These work with the standard txp:else logic to give you the ability to selectively display messages for the visitor.

  • txp:hit_logger_if_404 – condition is true if the user went to a page that didn’t exist on your site – they are forwarded to the current page and this flag is set.
  • txp:hit_logger_if_search – condition is true if the viewer came here from a search page (note it’s also true for search hits that resulted in a 404).
  • txp:hit_logger_if_own – condition is true if you were the person viewing the page. This could be useful for adding “edit” links to posts.
  • txp:hit_logger_if_spider – condition is true if the page was requested by a spider or robot. If you want to redirect or serve a special version of your page for automated web programs, this would be useful.
  • txp:hit_logger_if_duplicate – condition is true if the person has previously viewed a page on your website. This won’t work if the visitor has cookies disabled and only counts traffic since they started their web browser.

The tag code is pretty fresh, so I’d like any feedback. I still plan on some “list” tags: Top/Last xx Search Phrases, Top/Last xx Search Words, Top/Last xx Referrers, Top/Last xx Hits, Top/Last xx Posts, etc. Let me know if you think of any others…

Installation

I originally planned a bigger release, but I was able to keep this backwards compatible. If you’re upgrading, simply go to the “admin:plugins” page and uninstall the two plugins. Then install the new ones, enable them, and then view “extensions:logger prefs” and “admin:logs”. You’ll see some warnings during the upgrade, but once you view these two pages everything should be fine.

As always, the plugins are located at RandomOddness.com. And don’t forget to read the full docs.

Enjoy!

[Lee]


Monkeys could have written a better post..

Offline

#2 2005-09-15 23:30:09

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: hit_logger plugins alpha v0.9.05 now available!

Thanks, will give this a go :¬)

Offline

#3 2005-09-16 00:01:02

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: hit_logger plugins alpha v0.9.05 now available!

I’m watching this with interest Lee. :) Question: using the if_404 conditional would you be able to send the visitor to a custom 404 page or is this asking for trouble?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2005-09-16 00:24:02

LeeStewart
Archived Plugin Author
From: Boston, MA, US
Registered: 2005-07-25
Posts: 81
Website

Re: hit_logger plugins alpha v0.9.05 now available!

thebombsite wrote:
I’m watching this with interest Lee. :) Question: using the if_404 conditional would you be able to send the visitor to a custom 404 page or is this asking for trouble?

The plugin sets up a configuration screen under the “extensions” tab. One of the parameters is ‘log_default_404_url’, which is the site I redirect 404s to. By default it’s the main page of your site (or whatever you’ve configured “Site URL” to be). You can specify a section on your site, like www.randomoddness.com/404 or whatever URL you want (even another site like www.google.com, I suppose).

No need to mess around with the tags for custom 404 support!

[Lee]


Monkeys could have written a better post..

Offline

#5 2005-09-16 02:43:22

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: hit_logger plugins alpha v0.9.05 now available!

That was the correct answer. :) Next question then. I’m not in the least bit interested in the hit-logging side of things so will I need to install all the bits or can I just install whichever bit does the 404?

Last edited by thebombsite (2005-09-16 02:43:40)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2005-09-16 03:33:31

LeeStewart
Archived Plugin Author
From: Boston, MA, US
Registered: 2005-07-25
Posts: 81
Website

Re: hit_logger plugins alpha v0.9.05 now available!

thebombsite wrote:
That was the correct answer. :) Next question then. I’m not in the least bit interested in the hit-logging side of things so will I need to install all the bits or can I just install whichever bit does the 404?

I suppose you could just install the hit_logger plugin – the existing logging will work alongside mine and you can use the existing admin:logs page to view the hits that are logged by the Textpattern system. In the config screen, you can turn off all of the options under the “speed” section to make the code run faster (although this will cause some tags to be disabled, you might want the ‘log_track_search_info’ option enabled).

The only downside is that you’ll make me cry.

[Lee]


Monkeys could have written a better post..

Offline

#7 2005-09-16 03:43:42

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: hit_logger plugins alpha v0.9.05 now available!

:grin: I’ll have a good look at it tomorrow then. I think it’s way past my bed-time right now.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#8 2005-09-16 09:27:47

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Re: hit_logger plugins alpha v0.9.05 now available!

Lee,

I said that I would feedback more about installation issues with the plugin.

Following the instructions on a brand new TXP install, I installed the logger, went to the extensions tab, and got this:

Unable to configure the database, the following occurred:
Table ‘txp_log_hit’ already exists
Duplicate entry ’1-log_track_search_info’ for key 1
Duplicate entry ’1-log_track_spider_info’ for key 1
Duplicate entry ’1-log_track_spammer_info’ for key 1
Duplicate entry ’1-log_track_os_info’ for key 1
Duplicate entry ’1-log_track_browser_info’ for key 1
Duplicate entry ’1-log_handle_redirects’ for key 1
Duplicate entry ’1-log_default_404_url’ for key 1
Duplicate entry ’1-log_advanced_view’ for key 1
Duplicate entry ’1-log_shorten_strings’ for key 1
Duplicate entry ’1-log_view_own_hits’ for key 1
Duplicate entry ’1-log_view_spider_hits’ for key 1
Duplicate entry ’1-log_view_spammer_hits’ for key 1
Duplicate entry ’1-log_view_search_hits’ for key 1
Duplicate entry ’1-log_view_friends’ for key 1
Duplicate entry ’1-log_view_duplicate_hits’ for key 1
Duplicate entry ’1-log_view_404_hits’ for key 1
Duplicate entry ’1-log_view_redirect_hits’ for key 1
Duplicate entry ’1-disable_hit_logger’ for key 1
Table ‘txp_log_searchqry’ already exists
Table ‘txp_log_searchphrase’ already exists
Table ‘txp_log_searchword’ already exists
Table ‘txp_log_lut’ already exists

You can attempt to clean up the database and try the database configuration again.
WARNING – This will remove all previously logged information!!!
Reinstall
Seriously, this is huge. You won’t be warned again.
Clicking will remove everything.
I’d use the blink tag if I could…

However, if I ignore this and go on to install the viewer, then view logs, all appears as expected.
Going back to the ‘extensions’ tab, I get the logger config prefs as expected.

Hope that helps.


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

#9 2005-09-16 13:25:04

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: hit_logger plugins alpha v0.9.05 now available!

hi lee,
upgraded without any prob. Looking forward to the next release


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#10 2005-09-16 15:42:21

LeeStewart
Archived Plugin Author
From: Boston, MA, US
Registered: 2005-07-25
Posts: 81
Website

Re: hit_logger plugins alpha v0.9.05 now available!

NeilA, is the system collect page hits? If you go into “View Details” page, what are the bottom two values in the “Quick Stats” list?

It should look something like:
First hit: 2005-09-08 20:02:03
Last hit: 2005-09-15 23:49:46

Thanks for testing!

[Lee]


Monkeys could have written a better post..

Offline

#11 2005-09-16 15:51:10

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: hit_logger plugins alpha v0.9.05 now available!

What can I say, awesome plugin. Lists all the logging goodness you need. Popular search terms is the most interesting!

Offline

#12 2005-09-16 16:31:00

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: hit_logger plugins alpha v0.9.05 now available!

hi lee
I take it that you did not look into the <a href=“http://forum.textpattern.com/viewtopic.php?pid=75815#p75815”>referrer url</a> yet…


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB