Page 1 of 4

Extension: Google Analytics

PostPosted: Tue Jun 09, 2009 9:02 pm
by Wim
NB!

The latest version of this extensions is available from extensions.pivotx: http://extensions.pivotx.net/entry/14/googleanalytics

------------------------------------------------------------------------------------------------------------------------

Extension Name: Google Analytics
Extension Author: Wim Bekkers / Bob den Otter
Download Location: see attachment

Extension Description

    Add the Google Analytics code to your PivotX pages with full control over tracking code customization.

    As a pre-requisite you need a Google Analytics account (of course!). In the extension configuration page within the PivotX dashboard you need to enter your UA code (looks like UA-xxxxxx-x) and you are ready to go.

    If you want to get the most out of your Google Analytics, then you may want to use the Advanced Customization options that are available. These allow you to track subdomains within one profile, setup your custom campaigns, change the session timeout limit, and use Google Analytics in combination with Urchin. All these settings can be managed from the extension configuration page.

Installation

    Step 1: Unpack the attached zip file in the pivotx/extensions/ directory on your server
    Step 2: in the PivotX admin menu go to the Extensions section and enable the googleanalytics hook extension
    Step 3: enter your UA code in the Extensions -> Configure Extensions -> googleanalytics section of the PivotX dashboard. Ignore all the other advance settings unless you know what you are doing!

As always: please provide feedback here in the forum!

Version 1.7.2 is now the latest version. Contains 2 new options: setting the path variable for the cookies and switching off display of stats in the dashboard. The latter doesn't work any more because the new API has not been incorporated yet. Anyone who wants to do that please feel free.

Re: Extension: Google Analytics

PostPosted: Wed Jun 10, 2009 11:32 am
by hansfn
Thx a lot for the contribution. We really need the help of the community to get PivotX running and extensions are crucial.

The code looks fine, too. (You have a mix of Unix and Dos line-endings in the file, but that isn't a problem.)

Re: Extension: Google Analytics

PostPosted: Wed Jun 10, 2009 3:50 pm
by Kevin
This will make a fine addition to extensions.pivotx.net. *cough* ;)

Re: Extension: Google Analytics

PostPosted: Wed Jun 10, 2009 3:58 pm
by Wim
hansfn wrote:The code looks fine, too. (You have a mix of Unix and Dos line-endings in the file, but that isn't a problem.)


;) Sharply observed! That is when you take an existing extension as a template and move it back and forth between Linux and Windows.

Re: Extension: Google Analytics

PostPosted: Wed Jun 10, 2009 4:05 pm
by hansfn
One other minor issue: Since this really is a hook and not a snippet (=template tag), the file should have been called hook_googleanalytics.php in stead of snippet_googleanalytics.php.

Re: Extension: Google Analytics

PostPosted: Wed Jun 10, 2009 4:07 pm
by Wim
Kevin wrote:This will make a fine addition to extensions.pivotx.net. *cough* ;)


I have just added this to the uservoice forum as an idea to finish up extensions.pivotx.net. I guess the more votes the higher the priority this will get from the PivotX development team?

Re: Extension: Google Analytics

PostPosted: Wed Jun 10, 2009 4:11 pm
by Wim
hansfn wrote:One other minor issue: Since this really is a hook and not a snippet (=template tag), the file should have been called hook_googleanalytics.php in stead of snippet_googleanalytics.php.


Yes, this is where I am missing the documentation since I never seem to be sure what makes it a hook or a snippet (the widget thing I figured out in the mean time).

But you are right of course, I will change this and call it hook_googleanalytics.php instead.

Re: Extension: Google Analytics

PostPosted: Wed Jun 10, 2009 5:27 pm
by Wim
Wim wrote:I will change this and call it hook_googleanalytics.php instead.


Version 0.2X is out now. The only change is that it is now a hook extension (instead of a snippet).

Re: Extension: Google Analytics

PostPosted: Wed Jun 10, 2009 10:28 pm
by Kevin
Wim wrote:
Kevin wrote:This will make a fine addition to extensions.pivotx.net. *cough* ;)

I have just added this to the uservoice forum as an idea to finish up extensions.pivotx.net. I guess the more votes the higher the priority this will get from the PivotX development team?

I tossed 3 points on this one. Great idea. ;) Peter is a super busy guy these days.. but he does such great work on the site design/functionality. We love you Peter! :ugeek:

Re: Extension: Google Analytics

PostPosted: Fri Jun 12, 2009 5:37 am
by nicklnro
Wim wrote:Desperately looking for testers for this extension!


I tested it, it works great. I am using Firefox 3.5 beta, that updated yesterday to 3.5 Preview and the Wysiwyg in the entry/page posting was no longer showing. I disabled the Google Analytics hook and tried again. Still no result. I believe it's a bug in the preview version of Firefox 3.5. Maybe the developers of PivotX will look into this.

Congratulations, Wim, great work!