Oct
30

Local Analytics v1.2.2

By Joyce on 30-10-2007

Local Analytics is a Wordpress plugin for integrating Google Analytics, the free web analysis service by Google, into your Word Press powered blog.  The plugin is highly configurable and also allows caching of the urchin.js ga.js file locally, inorder to enable faster loading of pages. The plugin is based on my PHP program for speeding up Google Analytics by hosting it locally.

The plugin is highly configurable, yet simple. A normal user only needs to specify his / her Analytics UID, while advanced users can completely configure the behavior of the plugin.

Features

  • Highly configurable
  • Compatible with latest Google Analytics Code Update [NEW]
  • Supports local caching of urchin.js for fast loading of pages.
  • Supports compression of the local javascript files using mod_gzip.
  • Includes support for tracking Adsense and YPN ad clicks [NEW]
  • Includes support for tracking email links, external links and file downloads.
  • Includes support for tracking subdomains and main domain in a single profile.
  • Includes support for tracking visits to Admin Panels.
  • Includes support for tracking logged in users.
  • Includes uninstaller for complete removal of the plugin (I’m sure that you won’t be using it :) ).

Advantages of Caching

  • Webpage loads faster, since user’s browser can use the existing connection with your web server to download the file and doesn’t need to create a new connection to Google’s server.
  • Sometimes, though very rarely, google servers become overloaded and your page load time will be affected drastically.
  • Some ad blockers are now blocking tracking services like Google Analytics. This script will be a work around to that too.

Screenshot

Here is a screenshot of the Options page  of the plugin.

[Screenshot] Local-Analytics

Requirements

Installation

  1. Download, unzip & upload the plugin to your ‘/wp-content/plugins/’ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. On plugin activation, it will automatically try to create  a file named local-urchin.js in the plugin directory. If it fails, you will see a notification message in the Admin Panel. In that case you will have to manually create the file and chmod it 666.
  4. Go to Options > Local Analytics and enter your Google Analytics UID and hit the Save Options button.

Upgrade

I recommend uninstalling the current plugin (using the uninstall button in Options > Local Analytics) and installing the new version.

Download

Current stable version of the plugin is v1.2.2.

You can download the plugin from the WordPress Plugin Repository.

Frequently Asked Questions

  1. Q. Google Analytics says that the code is not installed correctly. Is something wrong?
    A. Check whether you are seeing any error message in your Admin Panel. If so, fix it. Else ensure that Disable Local Analytics tracking option is unchecked in the Options page.
  2. Q. I am getting the following error in my pages. What should I do?
    Warning: eregi(): REG_EMPTY in /private/path/replaceforprivacy/wp-content/plugins/local-analytics/local-analytics.php on line 127
    A. Using the plugin in non www domains caused the warning in pre 1.12 versions. Please upgrade to the latest version. You have to uninstall the current plugin before upgrading. Alternatively, you may edit the Internal Domains field to fix the error.
  3. Q. I installed the plugin successfully. But I am getting the following error in my Admin Panel
    local-urchin.js does not exist. Please create it.
    A. The plugin automatically downloads and stores a fresh copy of urchin.js ga.js in the plugin directory, under the filename local-urchin.js. While activating the Local Analytics, if there are sufficient privilages, the plugin will automatically create the file. If it fails, then you will have to manually create the file and chmod it 0666. The best idea is to chmod the plugin directory 0666, before activating the plugin (so that the file will be created automatically on plugin activation).
  4. Q. I installed the plugin successfully. But I am getting the following error in my Admin Panel
    local-urchin.js is not writable. Please chmod it 666.
    A. See FAQ entry #4.
  5. Q. How can I chmod a file?
    Q. How can I change file permissions?

    A. You can chmod / change file permission using your FTP client. But the steps are different for different FTP programs. In most FTP clients, you can chmod a file by choosing the option Properties  from the right click context menu.  Also checkout this article by Stadtaus.com on changing file permission in 5 popular FTP clients.
  6. Q. Will Local Analytics integrate the Google Analytics reports within the WordPress Administration Panel?
    A. It is not possible with Local Analytics. But David Szpuner had pointed out an excellent plugin called Wordpress Reports by TanTan, which allows you to integrate your Google Analytics and FeedBurner stats within your Admin Panel.
  7. Q. How can I check whether the plugin is installed correctly or not?
    A. After activating the plugin, visit your blog and check the source of the page for the Local Analytics code. A sample code is given below.
    <!– Begin Google Analytics Code by Local Analytics Plugin –>
    <script type='text/javascript' src='http://www.domain.com/wp-content/plugins/local-analytics/local-urchin-js.php?ver=1.0′></script>
    <script type='text/javascript'>
    _uacct = "UA-XXXXXXX-X";
    urchinTracker();
    </script>
    <!– End Google Analytics Code by Local Analytics Plugin –>

    <!-- Begin Google Analytics Code by Local Analytics Plugin -->
    <script type='text/javascript' src='http://www.domain.com/wp-content/plugins/local-analytics/local-urchin-js.php?ver=1.0'></script>
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-XXXXXX-X");
    pageTracker._initData();
    pageTracker._trackPageview();
    </script>
    <!-- End Google Analytics Code by Local Analytics Plugin -->
  8. Q. I have activated the plugin. But I can’t find the Local Analytics code in my page source. What is the problem?
    A. First of all, ensure that the plugin is installed and configured correctly. If it not configured correctly, then you will see a notifcation message in your WordPress Admin Panel.
    If it is configured correctly, then ensure that the option “Disable Local Analytics tracking” is disabled and logout of your WordPress account, refresh your blog’s homepage (use CTRL + F5 to ensure that the page was not loaded from your browser cache) and check for the Local Analytics code in your page source.
    Please keep in mind that when you are logged in, your visits will be tracked only if you have enabled the “Track Users” option and have appropriate value set for the option “Max. Tracked User Level “.
  9. Q. I have another question that is related / not related to Local Analytics. What should I do?
    Q. My question is not answered above. What should I do?

    A. Either post your question as a comment below or contact me. I will try my best to help you solve it.

ChangeLog

  • v1.2.2
    • Changed relative reference to astrack.js with absolute reference to make the plugin compatible with blogs with different site and wordpress location.
  • v1.2.1
    • Minor update. Fixed a mistake in gzip compression, as pointed out by Sergey Biryukov
  • v1.2
    • Updated the plugin to make it compatible with latest Google Analytics code update
    • Added Adsense and YPN click tracking
  • v1.1.3
    • Fixed a minor error which caused a Bad arguments  warning when the Internal Domains field was left empty.
  • v1.1.2
    • Fixed an error which caused a REG_EMPTY warning in non www domains
  • v 1.1.1
    • Corrected a typo in error message
  • v 1.1
    • Fixed the error pointed out by Kevin
    • Removed the onclick events from RSS feed
    • Dropped domain name from tracked downloads
    • Edited admin panel to display configuration errors
    Read More   
127 Comments »
Chip on 8 November, 2007 at 2:56 pm #

Nice one, I’ve been looking for something similar and I ended up here. I will definitely install your plugin and try it.

It’s always so hard to check all the external analytics reports for my blog, or I’m just lazy :).

Joyce on 8 November, 2007 at 4:12 pm #

Thanks Chip. Please let me know if you have any problem using the plugin.

 
 
Ravan on 8 November, 2007 at 3:39 pm #

why would your page load slower when you place the google analytics code at the bottom? the call for urchin.js is done after the page has loaded! except for the closing body tag, but that is not a problem for any browser… or am i mistaken?

Joyce on 8 November, 2007 at 4:21 pm #

If you call the function urchinTracker() anywhere in your page, then you have to put the tracking code before that. To track the external and download links we have to call the above function, hence the file is loaded in the head section.

Using the code at the end of the page won’t make your page contents load slow, but you will have problems with your page’s onload event in some browsers. Because the onload event will be triggered only after all the embedded elements, including urchin.js, have completely loaded.

Ravan on 9 November, 2007 at 7:17 am #

Hi joyce, i see you are very actively supporting your plugin here. Very much appreciated :)

But i am a bit confused :roll: by your reply. Google Analytics actually TELLS me to put the code at the end:
Copy the following code block into every webpage you want to track immediately before the tag.” (notice, that is the closing body tag)

and then it shows me the code like:

_uacct = "UA-xxxxxx-n";
urchinTracker();

so on WP it should go straight into footer.php or done via a plugin using get_footer(), or am i mistaken?

Ravan on 9 November, 2007 at 7:24 am #

oh, even wrapping code in -code- tags like described below the form, doesn’t allow me to post code as text here… sorry, that makes my previous post very unclear :(

So the instructions by GA read (body tag translated here) “Copy the following code block into every webpage you want to track immediately before the closing body tag. and I suppose that I do not have to explain how the show the code (including the urchin.js call directly above the urchinTracker() script… (hope this is clear enough)

(Comments wont nest below this level)
Joyce on 9 November, 2007 at 9:14 pm #

Ravan,
Thanks for the compliment. But I think you still did not understand my point :)

First of all, let me tell you why Google recommends putting the code just before the closing body tag.
When Urchin was bought by Google and they released it for free as Google Analytics, they asked webmasters to put the code within the head section of the page. This ensures that urchin.js loads before the page starts loading. But soon the load on Google’s servers became too much and it started taking a very long time for urchin.js to load. Since the code was placed in head section, the page content too stopped loading. After this, Google started recommending users to put the code at the end of the closing body tag. So that atleast the content will load, even if their server is overloaded.

Now why are we putting the code in the head section?
For tracking external links and download links, we have to call the function urchinTracker on the onclick event of the links. If we call urchinTracker anywhere in the page, then we have to put the Analytics code before that. Suppose we inserted the code before the closing body tag and someone clicks on an external link before urchin.js loads. Then we won’t be able to track the click. In Local Analytics, the file is included in the head section. Hence we can track clicks even if the page has not loaded completely.

I think I have explained it clearly. If you still have any doubt, feel free to question me again.

 
Ravan on 11 November, 2007 at 4:40 am #

well, after such a clear explanation (it should go in your FAQ’s), i wouldn’t dare to question you again ;)

i only wonder why you go through so much trouble, just to catch those clicks before urchin.js loads. for me, stats are to see trends in visitor behaviour, not to wring every last click out of it just for high-scores (that is not a fair analogy, i know)… but i am sure you have a different point of view on this. please do not feel obliged to respond to this. but if you do, i would read it with much interest :) (quite open to changing my point of view and not being cynical in any way)

cheers, ravan

 
Joyce on 11 November, 2007 at 12:09 pm #

Hello Ravan,
I am only happy to reply to your questions. I also make mistakes and like it when others correct me. So feel free to question me. I will surely answer, if I can.

For a proper analysis of visitor trends, we need to know the exact stats. In GA we have a section named Length of Visit. That stat will be greatly affected by quick exits, if we don’t log them. It informs us what kind of articles our users like. Because if you don’t like a post/article, you will leave the page after reading the first few lines, right?

But David and Alex had requested the ability to include the code before the closing end tag. This has the advantage of slightly lesser pagesize and faster server side processing. But it will not log quick exits.

 
Morriz on 15 November, 2007 at 1:51 am #

Hi, what about users aborting a page load to go somewhere else? In your scenario these aborted loads would still be registered. I think thats not good data. Maybe its even worse than missing some clicks before onLoad. What do you think?

chek,

Morriz

 
Joyce on 15 November, 2007 at 7:47 am #

You are right, Morriz. Those visits will be logged.
In the next version of the plugin, I will add option to include the code in both header and footer. So that you can decide where to put the code.

 
 
 
 
 
Subscribed to comments via emailKevin S. on 8 November, 2007 at 4:01 pm #

Hi,

Nice plugin this is. Seems to be working OK but when i access my page from a RSS feed, I get the PHP error at the top.

Warning: eregi() [function.eregi]: REG_EMPTY in /home/macrike/public_html/wp-content/plugins/local-analytics/local-analytics.php on line 110

Any ideas to what could it be?

Joyce on 8 November, 2007 at 4:26 pm #

Hello Kevin,
Thanks for trying out the plugin. I will look into the warning now itself.

Joyce on 8 November, 2007 at 11:58 pm #

I was unable to replicate the error. But I edited the part of the code which, I believe, is causing the problem. Can you plz try the new version and let me know how it works?

Subscribed to comments via emailKevin S. on 9 November, 2007 at 12:02 am #

Yeah, the error seems to have gone.

Tanks for this great plugin and for the help! :grin:

(Comments wont nest below this level)
Joyce on 9 November, 2007 at 1:15 am #

Actually I should thank you for testing the plugin and reporting the problem. :)

 
 
 
 
 
Jared on 8 November, 2007 at 8:32 pm #

I am installing this as we speak, let’s see how it works!

 
Jared on 8 November, 2007 at 9:42 pm #

Ok, this is possibly a really dumb question.

Aside from installing, activating and saving my UID on the Options page, is there anything else I need to do for this to work?

Is there a report page that’s supposed to show up under my Admin panel on WordPress or will I just need to go to the Google Analytics page?

Joyce on 9 November, 2007 at 12:05 am #

Normally that is enough. But if you want to do anything more like tracking a subdomain or e-commerce transactions spanning multiple domains, then you need to add more code in the “Additional Tracking Code” textarea.

No, it is not possible to show your analytics reports in your WordPress Admin panel :) . You will have to visit you GA account to see the stats.

 
 
ekowanz on 8 November, 2007 at 11:08 pm #

hey looks great..i’ll give it a try :)
and yeah i hav same queation with Jared :) where’s the stat show up?or it hav to be 24 hour to stat being show up?
sory for my english

Joyce on 9 November, 2007 at 12:17 am #

Thanks :)
My English is also not very good :sad: .

and yeah i hav same queation with Jared where’s the stat show up?or it hav to be 24 hour to stat being show up?

No, sorry :)
You can see stats in your Google Analytics Account page. GA is not a real-time stats program, so you may have to wait a few hours to see the updated reports.

ekowanz on 9 November, 2007 at 10:11 pm #

i got this when i try to activated your plugins…can u give me a clue?wht i’m doing wrong?

Fatal error: Cannot redeclare locan_activate() (previously declared in /home/ekowzinf/public_html/wp-content/plugins/local-analytics/local-analytics.php:47) in /home/ekowzinf/public_html/wp-content/plugins/local-analytics/local-analytics.php on line 83

and i got this too

local-analytics.php does not exist. Please create it.

i hav change the chmod for your plugins, and it’s still not working :(

Joyce on 9 November, 2007 at 10:34 pm #

Please uninstall and remove the current plugin and install v1.11. The errors will be gone :)

BTW, checkout the comment by David if you want to integrate GA stats within your WordPress Admin Panel.

(Comments wont nest below this level)
ekowanz on 13 November, 2007 at 2:07 pm #

hey…thx for the response..
i’ll try it soon

 
 
 
 
 
kljs on 8 November, 2007 at 11:11 pm #

I got a fatal error activating the plugin using Wordpress 2.3.1

Joyce on 9 November, 2007 at 12:11 am #

Can you plz try the latest version and let me know the error message?
The new version will inform you if the local file is not writable.

 
 
Fermin on 9 November, 2007 at 12:03 am #

Hi Joyce,

After I download the zip file, it gives an error when trying to unzip. The zip file is not complete.

Thanks,

Fermin
http://www.ferminsuero.com

Joyce on 9 November, 2007 at 12:09 am #

Hello Fermin,
That is strange, because I am not experiencing any problem with unzipping. Anyway I have created and uploaded the zip file once again (this time at normal compression level).

 
 
Subscribed to comments via emailDavid Potter on 9 November, 2007 at 12:45 am #

I get the same problem. I’ve been trying all morning and even rebooted.

Joyce on 9 November, 2007 at 1:13 am #

Hello David,
Did you mean problem with unzipping the file? If so, did you try the latest version?

 
 
critical critic on 9 November, 2007 at 12:59 am #

I had a similar one working on my site and recently it stopped working. I’ll be giving yours an install later today. Thanks. :smile:

Joyce on 9 November, 2007 at 1:17 am #

Please let me know if you need any help with it. :)

 
 
Subscribed to comments via emailDavid Potter on 9 November, 2007 at 2:36 am #

I tried the latest, but whenever I try to open the downloaded zip file (I’m using Windows Vista to both download and open) I get an error saying the compressed folder is invalid. Weird. I see that others have downloaded it successfully, so I don’t know what could be causing it.

 
Leszek Pawlowicz on 9 November, 2007 at 3:21 am #

I am getting the error message:

Warning: eregi() [function.eregi]: REG_EMPTY in /home/freegeog/public_html/wp-content/plugins/local-analytics/local-analytics.php on line 127

Repeats 4 times.

And this is with the latest version of the plugin. Had to de-activate it.

Joyce on 10 November, 2007 at 6:10 am #

Leszek,
I have fixed the error. Please see the FAQ entry above.

 
 
Steve Belt on 9 November, 2007 at 3:35 am #

I too am finding that the downloaded zip file is invalid. Must be a recent change that will hopefully be fixed tomorrow.

 
Loden on 9 November, 2007 at 3:49 am #

me too…download not working :???:

 
Joyce on 9 November, 2007 at 4:59 pm #

@David, Steve, Loden
I have added added the files as a rar archive and as plain text files. Can you plz try that?

 
Joe Church on 9 November, 2007 at 9:08 pm #

I too had problems unzipping the file on Win XP Pro, SP2. I was able to download the files directly from the download section, and manually create the main folder. However, when I upload and activate the plugin - it tells me that local-analytics.php does not exist and asks me to create it. Something has to be getting corrupted here or something. The options page will load, but I get that error and am afraid its not working.

Joyce on 9 November, 2007 at 9:39 pm #

Joe,
Can you plz send me the corrupted zip file at contact (AT) joycebabu.com?

The error message had a typo in it. The message is actually

local-urchin.js does not exist. Please create it.

The plugin will automatically try to create an empty file named local-urchin.js in the plugin directory. If it was not created, then you should manually create it and chmod it 666. Urchin.js will be periodically downloaded and stored in this file.
The best option will be to chmod the entire directory and its contents 666, before activating the plugin.
I have fixed the type and reuploaded the plugin v1.11. This time I have used 7-Zip to create the archive. And I have also checked the archive for compression errors.

 
 
Subscribed to comments via emailDavid Szpunar on 9 November, 2007 at 9:17 pm #

This looks like an excellent plugin! I am currently using Google Analyticator but it appears your plugin adds many options. I will try it out now.

Also, if anyone is looking for a way to view their Google Analytics reports within the WordPress admin panel, I’ve been using a plugin for a while called WordPress Reports that does this (and has FeedBurner stats as well). It doesn’t show all the possible reports, just some basic graphs (including trending), but it’s useful and keeps me from visiting the Analytics site daily!

It will also add the Google Analytics tracking code for you; but obviously make sure you turn this off if you use this Local Analytics plugin for that! Local Analytics appears to have many more configuration options. Thanks for the plugin!

Joyce on 9 November, 2007 at 9:44 pm #

David,
That is cool. I will try your plugin now itself.

I was also using Google Analyticator. Before creating this plugin, I tried almost every other Google Analytics plugins for Wordpress. I have added most of the common and useful options in Local Analytics. Now that many people found the plugin interesting, I will be adding more configurable options into the plugin shortly.

 
Joyce on 9 November, 2007 at 10:02 pm #

David. I installed your plugin. It is very very good. I will update this page to include a link to your plugin. Very good work.

Subscribed to comments via emailDavid Szpunar on 9 November, 2007 at 10:38 pm #

Thanks Joyce. But the WordPress Reports plugin is not “mine,” it is just one I’ve been using for a while. Glad you like it though; I certainly do! The TanTan Noodles site it came from has a nice variety of useful plugins.

Also, I am experiencing a problem similar to one mentioned above. I installed your plugin, and then the first post on my blog had several repetitions of this error in front of it: Warning: eregi(): REG_EMPTY in /private/path/replaceforprivacy/wp-content/plugins/local-analytics/local-analytics.php on line 127. I have since reverted to Google Analyticator for now but would like to figure out the error. I am running too many other plugins to name…but WP-Cache is the one that I would guess is the most likely to cause problems.

Subscribed to comments via emailDavid Szpunar on 9 November, 2007 at 10:44 pm #

One more thing. You claim that the urchin code must be called before the outgoing links are listed to make sure they are tracked. This makes sense. However, it appears that Google Analyticator gets around this while keeping the urchin code in the footer. It uses another JavaScript file (mine is here) called after the urchin script that goes through and adds the outbound link tracking code to all links on the page after the Google code has been loaded. It seems to accomplish both goals at the same time, and cuts down on page size by not adding the onclick event to each link as it comes from the server. I thought it was ingenious!

(Comments wont nest below this level)
Joyce on 10 November, 2007 at 6:03 am #

David,
Oops! Sorry. I read your comment too fast :oops: .

Nice idea. I will try to add that option into the next version. :)

 
 
 
 
 
Not a Niche on 9 November, 2007 at 9:47 pm #

Hey Joyce,

would it be also possible to have the google script at the footer of the source code, which would make it even faster?

Thanks

Alex

Joyce on 9 November, 2007 at 10:14 pm #

Hello Alex,
If you have enabled the gzip compression option included within the plugin or if you have tried the mod_deflate compression technique, then the file size will be just 6 KB and it won’t slow up your page loading. But now that you have asked for such an option, I will surely include it in the next version of the plugin.

Not a Niche on 10 November, 2007 at 3:54 am #

Thank you Joyce,

would be great if you can include such an option to include it in the footer and not only in the header. Also the workaround what David Szpunar mentioned would be really great, so you would get the best performance out of it.

Alex

Joyce on 10 November, 2007 at 6:04 am #

Alex, I will try to add that option into v1.2. But before that I want to make the current release stable.

(Comments wont nest below this level)
Not a Niche on 10 November, 2007 at 8:21 pm #

Thanks Joyce, I understand :)

 
 
 
 
 
Joe Church on 9 November, 2007 at 9:48 pm #

I still get an error saying the zip file is corrupted. I can extract it with winrar, but it only contains the local-analytics.php file, all other files are missing.

 
Joe Church on 9 November, 2007 at 9:51 pm #

I just tried to e-mail you back the file, and I get this error from my SMTP relay…

552 5.7.0 Illegal Attachment g39si4347891rvb>

Something is definately wrong with the file.

Joyce on 9 November, 2007 at 10:11 pm #

Thanks a lot for your continued help. I have created a tar.gz archive too. Can you plz try it?

http://www.joycebabu.com/wp-content/uploads/2007/11/local-analytics.tar.gz

BTW, I have updated the plain text files and the rar files too, so that you can install the plugin.

 
 
Leszek Pawlowicz on 9 November, 2007 at 11:15 pm #

Changing the permissions on the local-urchin.js file fixed the problem - thanks! BTW, I can open the zip file, but got an error message on the tar.gz file.

 
Leszek Pawlowicz on 9 November, 2007 at 11:16 pm #

Whoops - spoke too soon. Got three of the following at the top of every blogpost:

Warning: eregi() [function.eregi]: REG_EMPTY in /home/freegeog/public_html/wp-content/plugins/local-analytics/local-analytics.php on line 127

Subscribed to comments via emailDavid Szpunar on 9 November, 2007 at 11:20 pm #

Well at least we seem to have gotten to a common error Leszek, since that’s where I’m at! I downloaded the .zip file again but the files all say version “1.1″ and not “1.11″ so I’m not sure why I’m not getting the latest version downloaded…and I am using WordPress 2.3.1, not just 2.3.

Joyce on 10 November, 2007 at 6:12 am #

I tried to automatically populate the Internal Domains field. But I had checked it only with www domains. Hence it created problems when run accessed from a non www page.

 
 
 
Subscribed to comments via emailTom W. on 9 November, 2007 at 11:19 pm #

Hey there - love this plugin, but I get the following error message on my admin screens:

local-urchin.js does not exist. Please create it.

Did I miss a step somehow?

Thanks!!!!

Joyce on 10 November, 2007 at 6:06 am #

Tom,
Thanks :).

I have added it as an FAQ entry. Please check it.

 
 
Joe Church on 9 November, 2007 at 11:50 pm #

I still get the corruption error on the files when I download them.

Joyce on 10 November, 2007 at 6:15 am #

I don’t get any idea why it is happening like this. For some people, including me, it is working fine. While some are finding the file corrupted. :(

Let me look into it again.

 
 
Subscribed to comments via emailRobert on 10 November, 2007 at 3:35 am #

Great plugin - thanx for your work. Just got one problem: I use the plugin “cforms contact form by delicious:days” and together with Local Analytics on WP2.3 I get the following error: Warning: eregi() [function.eregi]: REG_EMPTY in /[…]/wp-content/plugins/local-analytics/local-analytics.php on line 127
Do you have any idea how to fix this?

Joyce on 10 November, 2007 at 6:13 am #

Robert,
See the FAQ entry above.

 
 
Subscribed to comments via emailMissy on 11 November, 2007 at 12:48 am #

Hi—Joyce: This plug seems really cool. I have a question,i hope its not to much of a dumb one. But how do i tell which version of Wordpress i have?

My blog is:
http://www.groovyvegetarian.com

Is it located in my wp admin panel, webhost cpanel, or where?

Missy.

Joyce on 11 November, 2007 at 12:57 am #

Hello Missy,
Thanks for the compliment.

Login to your wordpress control panel. And you can see your wordpress version at the bottom of the page.

You are running WordPress v2.2.1 (I created an account at your blog). Though I haven’t checked the plugin in WordPress v2.2.1, it should work fine in that version too.

Please feel free to contact me, if you need any help.

Subscribed to comments via emailMissy on 11 November, 2007 at 1:29 am #

Thanxs alot Joyce. I appreciate it. I will download the plug-in and try it. Thanxs! Will report back any wacky stuff. :smile:

Missy.

 
Subscribed to comments via emailMissy on 11 November, 2007 at 1:58 am #

Hi—I downloaded the plug-in and activated it in my wp panel, but google analytics kept showing the code was not showing on their end. I manually added the GA code to the header.php file in my theme, and now it works. So don’t know if i did something wrong, or if the plug-in doesn’t work on my blog.??? But i think GA is working on my blog. lol.

Joyce on 11 November, 2007 at 3:22 am #

After activating the plugin you have to ensure two things for the analytics code to show.
1. You have to enter your Analytics Account id in the Plugins options page (Options >> Local Analytics).
2. The file local-urchin.js in the plugin directory exists and is writable.

If both the conditions are not true, then you will see a notification in the Admin Panel that says, either “Google Analytics is not active. You have to enter your Analytics Account ID” or “local-urchin.js doesnot exist or is not writable.”

You have to fix that error first.

(Comments wont nest below this level)
Subscribed to comments via emailMissy on 11 November, 2007 at 5:44 am #

Hi—I did add my GA ID in the options page.
I don’t know anything about the local-urchin.js file, i don’t even know where it’s located. What do i have to do to this file?

Also does it take some time for all to show? Because i notice Leszek (commenter below) said she wont know if she did it right, till tomm. Or is her issue totally unrelated to mine.

 
Joyce on 11 November, 2007 at 12:40 pm #

Missy,

If you don’t have the urchin.js file or if it is not writable, you will see an error message in the admin section. Can you see anything like that?

Google Analytics takes a few hours to report the stats. It is not a real-time stats software.

The best method to check whether everything is fine is to re-activate the plugin and view the source of the page (from your right click context menu or from View >> Source) and check for something like

<!– Begin Google Analytics Code by Local Analytics Plugin –>
<script type=’text/javascript’ src=’http://www.groovyvegetarian.com/wp-content/plugins/local-analytics/local-urchin-js.php?ver=1.0′></script>
<script type=’text/javascript’>
_uacct = “UA-XXXXXXX-X”;

urchinTracker();
</script>
<!– End Google Analytics Code by Local Analytics Plugin –>

If you are still unsure, please reactivate the plugin and post a comment here. I will check it for you :)

 
Joyce on 11 November, 2007 at 12:41 pm #

I checked your site and local-urchin.js exists.Which means your configuration is fine. Activate the plugin and wait for a few hours to see the stats.

 
 
 
 
 
Leszek Pawlowicz on 11 November, 2007 at 2:46 am #

Read the FAQ entry, and sure enough it fixed the problem. Seems to be working fine now, though I won’t know for sure until tomorrow. Thanks!

 
Joyce on 12 November, 2007 at 10:41 pm #

Since no more errors were reported, I am making declaring this release (v1.12) stable. Thanks a lot to everyone for trying and supporting the plugin.

 
Andrew B on 13 November, 2007 at 11:51 am #

Hi Joyce,

Warning: implode() [function.implode]: Bad arguments. in /home/thoughts/public_html/wordpress/wp-content/plugins/local-analytics/local-analytics.php on line 245

I’m getting the above error everytime I change settings in the Admin Panel. It doesn’t seem to affect the operation of the program, but pops up after saving. I’m running WP 2.3.1

Joyce on 13 November, 2007 at 8:51 pm #

Andrew,
You are getting the warning, since you left the “Internal Domains” field empty. I have fixed the error and uploaded v1.13. Please download and install the latest version.

If you have enabled the option “Track Outgoing Clicks”, then I recommend you not to leave the field empty. You should put your current blog location(without the protocol) in that field so that clicks on internal links having the domain name (eg: http://www.joycebabu.com/downloads/local-analytics/) are not tracked as outgoing clicks.

 
 
Baris Unver on 13 November, 2007 at 1:50 pm #

Hey there. I activated the plugin, changed my options (added the ID there), and local-urchin.js is created, and the PHP function wp_head exists in my header.php, but still the code does not show up in the source. I disabled the plugin and re-enabled, Ctrl+F5′d the homepage etc. but I couldn’t fix it. What do I do?

Joyce on 13 November, 2007 at 8:15 pm #

Baris,
I have added the question to the frequently asked questions section. Plz check FAQ #8 and reply if the problem persists.

Baris Unver on 13 November, 2007 at 8:23 pm #

Holy crap, you’re right! :) I couldn’t see the code because I was logged in as an admin :) Thanks a lot.

Joyce on 13 November, 2007 at 8:55 pm #

Thanks for using the plugin.

BTW, you can track admin visits too by setting “Max. Tracked User Level” to ‘Administrator’.

(Comments wont nest below this level)
 
 
 
 
n-blue on 17 November, 2007 at 11:56 am #

Will you implement TanTan plugin to eneble local view of stat? I think this will be usefull to blogger, when we can see stat in admin page.

Joyce on 17 November, 2007 at 12:02 pm #

My exams university exams start next month and I have lot to do before that. So I am running short of time. I will try to do what I can.

 
 
n-blue on 17 November, 2007 at 11:45 pm #

So, please focus on your exam.It’s real important thing. Forgot about plugin for a moment and success with examination. :wink:

 
Subscribed to comments via emailraj on 11 December, 2007 at 12:55 am #

Hi, Just to be sure I understand, I do not need to copy and paste the analytics code on my site or any php files right? all I need to do is enter my Google Analytics UA after installing and enabling plug in right? so, after that where do I get the stats?

Joyce on 11 December, 2007 at 9:17 am #

@Raj
Yes, you are correct. The plugin will automatically insert the GA code in the required pages. You can see the stats from your Google Analytics accounts as usual.

 
 
DG on 14 December, 2007 at 6:32 pm #

Hello Joyce,

When you’re planning to update your Analytics plugin for new Google Analytics script code?

You can read about the new script here..

Also, will it be possible for you to add AdSense click tracking functionality?

DG…

Joyce on 18 December, 2007 at 8:08 am #

Thanks for notifying me, DG. And sorry for the late reply.

I will try to update the plugin by tomorrow or the next day. I will also give Adsense Click Tracking a try. Nice suggestion.

 
 
Sergey Biryukov on 23 December, 2007 at 6:00 am #

Hi Joyce,
Look at local-urchin-js.php, line 48.
I guess instead of locan_cache_time option we should read locan_use_gzip to set $useGzip. Or am I missing something?

Joyce on 23 December, 2007 at 11:31 am #

@Sergey - You are correct. Thanks for pointing it out. I have updated the plugin.

 
 
Kordump on 28 December, 2007 at 3:22 am #

hello

GA isn’t recognizing the script on the GA page although i’ve made sure the code is there in the page source, right before the end of the head tag and again something i don’t really understand after the closing html tag.

i’m using one of those free mySQL/PHP web hosts. could that be it?

thank you very much for this usefull plugin.

Joyce on 30 December, 2007 at 10:49 am #

@Kordump
Can you plz tell me where you have installed the plugin? Local Analytic inserts the GA code only in the head section. I think you are using two GA scripts on your page. Is the plugin tracking your traffic?

Kordump on 10 January, 2008 at 10:10 pm #

hello

sorry for not answering your questions. i now believe the problem is something with my free host and/or my config of wordpress itself and i’ve found out there is a lot more to be learned before messing with analytics.

thank you very much for writing and supporting this plugin and i would like to excuse myself again for not answering before.

cheers and best of luck with all your projects!

Joyce on 11 January, 2008 at 10:38 am #

Its ok. Hope you have fixed the problem.

(Comments wont nest below this level)
 
 
 
 
Subscribed to comments via emailMartin Lee on 2 January, 2008 at 12:27 pm #

Hi Joyce,

I have my wordpress installed on a subdirectory on my website but my blog is configured to show on the root.

Because of that, the calls to local-astrack.php are referencing the wrong location. Will you be able to patch that up?

Thanks!

Joyce on 11 January, 2008 at 11:15 am #

Martin,
I am sorry for the late reply. I had actually updated the plugin the same day. But I forgot to upload it to the svn repository. Can you plz download and try the latest version?

Subscribed to comments via emailMartin Lee on 11 January, 2008 at 1:03 pm #

Thanks Joyce!
Will try that out.

 
 
 
Dmytro on 2 January, 2008 at 4:24 pm #

Dear Joyce

Your plugin is brilliant, thanks! But I have a small bug with ‘keywords’ (they are in Russian) in my Google Analytics panel. They are totally unreadable, - appear as ‘%d1%80%d0%b0%d0′, not as normal words.

What is your advise?

Joyce on 11 January, 2008 at 11:13 am #

Dmytro,
I don’t think it has anything to do with the plugin. Because what the plugin do is only insert the required code into your blog.

 
 
Gage on 3 January, 2008 at 11:33 pm #

Hello