Jump to content
Wanze

ProcessGoogleAnalytics

Recommended Posts

I remember discovering that admin pages are in the tree... Great times ;)

  • Like 1

Share this post


Link to post
Share on other sites

Yep it took me some time too, allthought i'm not surprised with a system flexible as Processwire.

You can change the structure of the Backend the way you like it O0

Share this post


Link to post
Share on other sites

I wanted to move modules into setup as I'm not in there that often but I guess not all pages can be subpages. Still, it's great that it's so easy to modify so much

Share this post


Link to post
Share on other sites

Hi Processwires!

Just updated the module with some small improvements:

  • Loading Animation for each section for better usability
  • Date Range: If your range is smaller than 3 days, the module queries the visitors per date AND time. For example: If your date range is "24 hours" back, then you will now get the count of visits per hour. Before, you only got a straight line between two dates. ;-)
  • Optional feature: For the visits and pageviews, the module allows you to display the difference compared to the previous date range. This should give you a quick idea, if your website has more or less visitors compared for example to the month before.
    See the attached Screenshot
    By default this setting is disabled, but you can enable it in the module settings

I also updated jqplot and the Google API Client to the newest versions. Let me now if you run into problems with some setups!

Cheers

post-582-0-27331800-1353119965_thumb.png

  • Like 4

Share this post


Link to post
Share on other sites

Works great! Nice updates wanze!

Also, updating is a breeze thanks to soma's wonderfull Module Manager.

Share this post


Link to post
Share on other sites

Hi Wanze, I have no idea why but going to my analytics page now in admin crashes the whole page.

I tried updating and now it's stuck with the loading image too.

It seems to only happen to me with Chrome though (I'm on a Mac) though that may be as it's where I've been using it before. Can't think why it's doing this, any ideas?

Thanks

Share this post


Link to post
Share on other sites

Hmm do you get any error messages in your Javascript Console in Chrome?

I'm also on Mac and it seems to work fine here with chrome.

Try:

  • Clear the browsers cache
  • Clear the cache from the statistics generated with MarkupCache
    => Go to the module options and for example change the default date range and save, this should also clear the MarkupCache behind.

Does it work with other browsers?

Btw I just noticed that Chrome does not support APNG, so I will change the loading animation to a gif..

  • Like 1

Share this post


Link to post
Share on other sites

Hi Wanze, clearing MarkupCache seems to have sorted it for me, thanks a lot.

Will let you know if it comes back.

Share this post


Link to post
Share on other sites

Comitted a new version to GitHub.

There are no new "must-have" features, it was more refactoring the code with some small improvements:

  • Use my own (lightweight) class to query the stats instead of the bloated google api php client
  • Removed config options not really necessary for simpler setup: Developer-Key, Redirect-Uri
  • Use "MarkupAdminDataTable" to generate the tables - they integrate better in other admin themes
  • Custom date range bypasses caching of the regular date range - no need to "clear the custom date range"
  • Added option to clear the statistics cache under the options tab
  • Added some more comparisons to the previous date range

So it's up to you if you want to update :)

Important

If you update, you need to revoke authentication and choose the Google Analytics account again.
Check "Revoke Authentication" in the module's config and save, visit the Google Analytics page and click "authenticate".

Then choose the account again.

  • Like 4

Share this post


Link to post
Share on other sites

Hi Wanze,

Have you ever seen it happen where another site's content ends up in the analytics content?

It's very strange as I have a completely unrelated site with different UA codes. Not sure if you've ever come across that?

Cheers.

Share this post


Link to post
Share on other sites

Hi onjegolders,

I've never seen this before. Could you check if you see the content also by viewing the statistics in the normal UI from google?

Share this post


Link to post
Share on other sites

Hi Wanze,

Thanks for the reply have since seen that it's the same in Google's UI. Very strange!

Share this post


Link to post
Share on other sites

I had the same once with woopra, I was seeing the stats of one guy, and he was seeing my stats. We told them, and they corrected.

  • Like 1

Share this post


Link to post
Share on other sites

Thing is here is that they're both "my" sites so it makes me think somehow it's not a coincidence. But the UA tag is def different. Anyway am giving Piwik a try as it's about time I looked at the competition!

Share this post


Link to post
Share on other sites

Wow, this is one sexy module. Thank you! Just installed on my newly processwire'd CMS Critic!

  • Like 3

Share this post


Link to post
Share on other sites

Great module!

I only have one problem - cannot get it running on my VPS (runs great locally on MAMP).

When trying to authenticate I get: Could not fetch the accessToken (Apache 2.2.5/PHP 5.4.19)

I've tested it on two sites and also on a fresh install of the latest build - same result.

Any ideas?

Share this post


Link to post
Share on other sites

Hi Peter,

Thanks!

My guess is that you maybe forgot to add the redirect URL in the Google APIs console which points to your VPS server?

Here is where this error comes from: https://github.com/wanze/ProcessGoogleAnalytics/blob/master/ProcessGoogleAnalytics.module#L955

Google does not return a HTTP 200 status. If you can't solve the problem by setting the redirect URI, you can try to add this code:

if ($auth['http_code'] != 200) {
  print_r($auth); die(); // Add this line and check which error code is returned
  $this->error('Could not fetch the accessToken');
  return;
}

Good luck :)

  • Like 1

Share this post


Link to post
Share on other sites

Thanks John!

@Peter

I can't access your Pw admin :)

Can you post here what was printed out? Should be an array with a status code other than 200.

If nothing was printed, then this seems to be an issue with the curl setup of your server.

I coded the class which is interacting with google. Recently there turned up a similar problem on one installation.

Not sure if this solves the problem here, but you could try to add this line in the GoogleAnalyticsAPI.class.php file,

after this line here

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 

Share this post


Link to post
Share on other sites

Thanks Wanze,

Nothing was printed out, but adding:

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 

in the GoogleAnalyticsAPI.class.php file did the trick.

Thanks again for an excellent module.

-Peter

Share this post


Link to post
Share on other sites

@JoZ3

Does this happen only in Firefox? Another browser does work?

The statistics are loaded with ajax requests, so if nothing shows up, this normally means that there is an error happening on the server side.

Can you open you Javascript console, for example the native one in Firefox or the one in Firebug and check if you get any errors reported?

Share this post


Link to post
Share on other sites

@Wanze. This module is even more useful then the analytics at google.com/analytics/

Those contain so much info, customers drowning in it.

Your's has the right balance, just what we/they need.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MoritzLost
      This is a new module that provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Beta release
      Note that I consider this a Beta release. Since the module is relatively aggressive in deleting some caches, I would advise you to install in on a test environment before using it on a live site.
      Let me know if you're getting any errors, have trouble using the module or if you have suggestions for improvement!
      In particular, can someone let me know if this module causes any problems with the ProCache module? I don't own or use it, so I can't check. As far as I can tell, ProCache uses a folder inside the cache directory to cache static pages, so my module should be able to clear the ProCache site cache as well, I'd appreciate it if someone can test that for me.
      Future plans
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory

    • By joshua
      This module is (yet another) way for implementing a cookie management solution.
      Of course there are several other possibilities:
      - https://processwire.com/talk/topic/22920-klaro-cookie-consent-manager/
      - https://github.com/webmanufaktur/CookieManagementBanner
      - https://github.com/johannesdachsel/cookiemonster
      - https://www.oiljs.org/
      - ... and so on ...
      In this module you can configure which kind of cookie categories you want to manage:

      You can also enable the support for respecting the Do-Not-Track (DNT) header to don't annoy users, who already decided for all their browsing experience.
      Currently there are four possible cookie groups:
      - Necessary (always enabled)
      - Statistics
      - Marketing
      - External Media
      All groups can be renamed, so feel free to use other cookie group names. I just haven't found a way to implement a "repeater like" field as configurable module field ...
      When you want to load specific scripts ( like Google Analytics, Google Maps, ...) only after the user's content to this specific category of cookies, just use the following script syntax:
      <script type="optin" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> <script type="optin" data-type="text/javascript" data-category="marketing" data-src="/path/to/your/mareketing/script.js"></script> <script type="optin" data-type="text/javascript" data-category="external_media" data-src="/path/to/your/external-media/script.js"></script> <script type="optin" data-type="text/javascript" data-category="marketing">console.log("Inline scripts are also working!");</script> The type has to be "optin" to get recognized by PrivacyWire, the data-attributes are giving hints, how the script shall be loaded, if the data-category is within the cookie consents of the user. These scripts are loaded asynchronously after the user made the decision.
      If you want to give the users the possibility to change their consent, you can use the following Textformatter:
      [[privacywire-choose-cookies]] It's planned to add also other Textformatters to opt-out of specific cookie groups or delete the whole consent cookie.
      You can also add a custom link to output the banner again with a link / button with following class:
      <a href="#" class="privacywire-show-options">Show Cookie Options</a> <button class="privacywire-show-options">Show Cookie Options</button> This module is still in development, but we already use it on several production websites.
      You find it here: https://github.com/blaueQuelle/privacywire/tree/master
      Download: https://github.com/blaueQuelle/privacywire/archive/master.zip
      I would love to hear your feedback 🙂
      Edit: Updated URLs to master tree of git repo
       
    • By David Karich
      Admin Page Tree Multiple Sorting
      ClassName: ProcessPageListMultipleSorting
      Extend the ordinary sort of children of a template in the admin page tree with multiple properties. For each template, you can define your own rule. Write each template (template-name) in a row, followed by a colon and then the additional field names for sorting.
      Example: All children of the template "blog" to be sorted in descending order according to the date of creation, then descending by modification date, and then by title. Type:
      blog: -created, -modified, title  Installation
      Copy the files for this module to /site/modules/ProcessPageListMultipleSorting/ In admin: Modules > Check for new modules. Install Module "Admin Page Tree Multible Sorting". Alternative in ProcessWire 2.4+
      Login to ProcessWire backend and go to Modules Click tab "New" and enter Module Class Name: "ProcessPageListMultipleSorting" Click "Download and Install"   Compatibility   I have currently tested the module only under PW 2.6+, but think that it works on older versions too. Maybe someone can give a feedback.     Download   PW-Repo: http://modules.processwire.com/modules/process-page-list-multiple-sorting/ GitHub: https://github.com/FlipZoomMedia/Processwire-ProcessPageListMultipleSorting     I hope someone can use the module. Have fun and best regards, David
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "https://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


×
×
  • Create New...