Bug #10722

StatPress performance & migrate to per-site Google Analytics

Added by Boone Gorges 5 months ago. Updated about 21 hours ago.

Priority name:
Category name:
Target version:
Start date:
Due date:
% Done:


Estimated time:


We disabled StatPress for new users some time ago, but for existing users, it's a true beast. The database tables are enormous and poorly designed, and the admin is so slow on large sites to be near unusable.

It will be tough to take away people's stats without having a good replacement. I know that we have given per-site access to Google Analytics in the past. Scott, would you mind providing info on how many people are using this, and how hard it is for you to set up when it's requested?

I'd like to explore the possibility of simply removing StatPress from the system, which would mean removing the corresponding database tables. This likely means preparing some sort of report on where it's activated. Some sites that have it turned on may not be active anymore, or may be using a custom Google Analytics report instead. In those cases, it'll be pretty painless to remove.

We may look into a better system for allowing people to link their sites to their own Analytics accounts. See This could be self-service.

In the meantime, there may be things we can do to mitigate the awful performance. See

Screenshot_2019-03-13_14-37-04.png (19.4 KB) Screenshot_2019-03-13_14-37-04.png Boone Gorges, 2019-03-13 03:43 PM

Related issues

Related to CUNY Academic Commons - Feature #5581: Explore alternatives to Google AnalyticsAssigned2016-05-21


#1 Updated by scott voth 5 months ago

Hi Boone - We have 49 views right now on Google Analytics. It doesn't take too long to set up the view, create a report, notify the user, and make sure it is working - probably about 30 minutes. I think we are reaching our limit of views (50 per property) but apparently you can add properties to an account and accounts to a login - I am not actually sure how this works - see

#2 Updated by Boone Gorges 5 months ago

  • Assignee set to Boone Gorges

Thanks, Scott. I'm going to research this a bit more. I think our best path forward may be to allow users to enter their own Google Analytics account info into their WordPress site, and then to transition existing StatPress users over to that system. I'll take some time in the upcoming month or two to see exactly how this would work.

#3 Updated by Boone Gorges about 2 months ago

  • Category name set to Analytics

#4 Updated by Boone Gorges about 1 month ago

I did some research into existing WordPress tools that would serve our purposes. They are all extremely bloated, and none appears to work both with Multisite and with multiple GA IDs on a single page.

So I've written a bare-bones implementation in On wp-admin/options-general.php, I've added a "Google Analytics ID" field. If filled-in, a second GA property is added to the pageview tracker. See screenshot for the admin interface.

As currently built, it's automatically active on every Commons site. Obviously, it will only do something if the admin has filled in a GA ID. I did this to minimize overhead - this way, there's no plugin to activate. However, it does make the feature seem like it's officially endorsed by the Commons, which we might not like - though we do already use GA throughout for our own purposes.

You'll see in the screenshot that I've given a very brief description of what a Tracking ID is, and then there's a "Learn More" link. I imagine that this would be a Commons help page explaining what GA is, and a brief primer on how to create a property, get the Tracking ID, enter into the Commons, and access the GA reports.

Scott, Matt, what do you think?

#5 Updated by Matt Gold about 1 month ago

Wow, Boone -- this seems really promising! Just today, Lisa was noting that she wasn't receiving reports from GA (I've cc'ed her here)

Just so I understand, people would be able to connect their own personal GA ID to their Commons site through this plugin? And then, to check stats, they'd just log in to GA to see them? That sounds like a really great option for our members!

#6 Updated by Boone Gorges about 1 month ago

Just so I understand, people would be able to connect their own personal GA ID to their Commons site through this plugin? And then, to check stats, they'd just log in to GA to see them? That sounds like a really great option for our members!

Correct. Some of the existing WP-GA tools put GA visualizations and data right into the WP Dashboard. A nice feature, but adds a ton of overhead.

#7 Updated by scott voth about 1 month ago

Looks good to me as well. GA can be overwhelming though - I guess we can provide an introduction to how it works and then send members to GA's documentation and tutorials.

#8 Updated by Boone Gorges about 1 month ago

Thanks, Scott. The documentation will be the most important thing to make this successful, which is why your thoughts are valuable :) But I agree 100% that we don't need to provide anything approaching complete docs for GA. There's tons of good documentation out there, and we should just link to a bit of it. The main thing would be the process of creating a property and getting the ID to enter into the Commons interface. If you think it's doable for you to prep this kind of documentation for 1.15, then let's go with this. (I'll get it all set up on cdev within the upcoming week or so, so that you can play with it.)

#9 Updated by scott voth about 1 month ago

Sure. It sounds doable for 1.15. I'm assuming we will just leave the views we have on our property (less that 25)?

#10 Updated by Boone Gorges about 1 month ago

Yes, I think we can leave them.

I'm more concerned about StatPress users. It'd be nice to move them to the new system. But this is something we can talk more about after 1.15.

#11 Updated by Raymond Hoh about 1 month ago

  • Related to Feature #5581: Explore alternatives to Google Analytics added

#12 Updated by Lisa Rhody about 1 month ago

I think the self-service option would be awesome. I did notice that our monthly stats report dropped off, and it would be good to have something as we prepare to launch the new site so that we can track deltas. Thanks for considering this, and looking forward to helping however we can.

#13 Updated by scott voth 10 days ago

I have created a help page for this -

Is the "Learn More" hyperlink going to point to this page?

#14 Updated by Boone Gorges about 21 hours ago

Thanks, Scott! I've pointed 'Learn More' to that page.

Also available in: Atom PDF