Bug #10722
closedStatPress performance & migrate to per-site Google Analytics
0%
Description
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 https://support.google.com/analytics/answer/1032400?hl=en. This could be self-service.
In the meantime, there may be things we can do to mitigate the awful performance. See https://www.saotn.org/optimize-wp-statpress-plugin-database-performance/
Files
Related issues
Updated by scott voth almost 6 years 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 http://gatipoftheday.com/google-analytics-account-limit-raised-from-25-to-100/#
Updated by Boone Gorges almost 6 years 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.
Updated by Boone Gorges over 5 years ago
- File Screenshot_2019-03-13_14-37-04.png Screenshot_2019-03-13_14-37-04.png added
- Subject changed from StatPress performance to StatPress performance & migrate to per-site Google Analytics
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 https://github.com/cuny-academic-commons/cac/commit/f23c17da99ea666962ddaae47f67580c4e961898. 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?
Updated by Matt Gold over 5 years 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!
Updated by Boone Gorges over 5 years 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.
Updated by scott voth over 5 years 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.
Updated by Boone Gorges over 5 years 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.)
Updated by scott voth over 5 years 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)?
Updated by Boone Gorges over 5 years 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.
Updated by Raymond Hoh over 5 years ago
- Related to Feature #5581: Explore alternatives to Google Analytics added
Updated by Lisa Rhody over 5 years 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.
Updated by scott voth over 5 years ago
I have created a help page for this - https://help.commons.gc.cuny.edu/setting-up-google-analytics-on-your-commons-site/
Is the "Learn More" hyperlink going to point to this page?
Updated by Boone Gorges over 5 years ago
Thanks, Scott! I've pointed 'Learn More' to that page.
Updated by Boone Gorges over 5 years ago
- Status changed from New to Resolved
Let's create a new ticket to track the migration away from StatPress. This one, for per-site GA, should be marked resolved.