About GA4 Support
-
Hi!
Now with
GA*edit: UA deprecating in the summer, any plans on making Toplytics compatible with GA4?Thanks!
-
This topic was modified 1 year, 11 months ago by
jimihenrik.
-
This topic was modified 1 year, 11 months ago by
-
@presslabs download link is not working. Can you provide new?
When will update with GA4 support be deployed?
It does feel like something’s still off with the beta. It uses _a lot_ of quota, and I can’t even connect all sites, some just time out every time I try to connect. Some sites connect just fine ???♂? (All sites have identical theme/plugins/settings, basically just content and styles change)
Edit: just to compare, the “old version” I had on 19 sites, never had problems with quota and even if the connecting was slow, it always worked. With the new version I got to connect 5 sites and those alone used my Google Cloud’s 10k per day quota already so I can’t connect more sites even if it’d work…
-
This reply was modified 1 year, 4 months ago by
jimihenrik. Reason: Added information
sure hope that the new version is released real soon.
Using this on a site to show what articles are hot right now and also most read during last 24h.
Hello @jimihenrik ,
Thank you for your feedback.
We fixed a few more glitches and added a few filters in this RC version https://dl.presslabs.net/temp/toplytics-v41-rc1.zip
If the feedback is positive we’ll publish it in 2-3 days.
Gonna test it first thing in the morning, thanks! ??
Thank you @jimihenrik . We’re looking forward for your feedback.
Hey, @cobraeyes! We appreciate your patience. Please test this latest version using this: https://dl.presslabs.net/temp/toplytics-v41-rc1.zip
Hi. Installed plugin nu. Installation was no problem on our live.
But it doesn’t seem to pull correct data. We show data from today in one feed, like whats hot right now, and also from past week, not 24h as i said before. When i look in Google Analytics dashboard for today and past week I see completely different data.
Looking at the feed we have for Today, Toplytics seems to be using the data for the past 90 days for that and the past 6 months for the weekly feed.
Guess this is a bug that you can fix? ??
New version seems to connect perfectly and even update way faster than the UA one. The comment above might be right but I wouldn’t notice that as we have our own custom filters to show posts only published in the past X days and what not…
Thanks for the update ??
EDIT: Just as info for anyone testing out the new version, the GA4 version uses Google Analytics Data API instead of Google Analytics API so be sure to enable that in your Google Cloud Project ?? before connecting.
-
This reply was modified 1 year, 4 months ago by
jimihenrik. Reason: Added information
Hello @cobraeyes,
Thank you for your feedback. I’ll run some tests as well. I removed the Real-Time and Daily fetches as that data was not working well. So, there is no real-time or daily data this time. Maybe in another update in the future. Yet the default timeframes for week and month should still work as intended and can be potentially changed. They can be updated via filters or the database. These are stored in the database in the
toplytics_results_ranges
option. Can you test and see what is the value of this option? You can use WP CLI like so:wp option get toplytics_results_ranges --format=json | jq .
You can also try to change these via a hook like the following example. This is an example with a custom plugin that do this:
<?php /** * Plugin Name: Custom Toplytics Modifier * Description: Modifies the toplytics_results_ranges option. * Version: 1.0 */ add_filter('pre_option_toplytics_results_ranges', 'modify_toplytics_results_ranges'); function modify_toplytics_results_ranges($value) { // Modify the option values as needed $modified_value = [ 'month' => date_i18n('Y-m-d', strtotime('-25 days')), // Example modification 'week' => date_i18n('Y-m-d', strtotime('-5 days')), // Example modification 'today' => date_i18n('Y-m-d', strtotime('today')), 'realtime' => 0, ]; return $modified_value; // Return the modified value }
Docs for pre_option_ hook: https://developer.www.ads-software.com/reference/hooks/pre_option_option/
Hello @jimihenrik ,
Thank you for your feedback. I am glad it works well on your end. That’s amazing news.
Also you are correct. The plugin now uses the Google Analytics?Data?API
It seems that the widget that uses the week range is working now.
The second place where we have a widget is with a shortcode with a “today” result range. I’ve changed that shortcode to use the month result range instead, but it is still incorrect.
With the filter function I have modified the date range for month to ‘-1 day’ but it didn’t help. Still shows articles that are months old.?
Tested to change to week instead and that got it to show the same as the widget. But if I, in the filter function, set the same date range for month as for week, it still shows articles that are months old. So it seems even month has some issues.How can we get the day range working? Our client really needs this, would be ideal to have data for the past hour.
Hello @cobraeyes ,
I forgot to mention, after you change the ranges via the filter you need to re-fetch the data from Google. You can press the button in the Settings page for that.
Also, it should update itself after 1 hour (default) or after what time you changed it to. This auto-update interval can also be changed in the settings.
So just to double-check, after you added that filter, and pressed the Update Top button, it still didn’t work?
Also, please note that a small deviation from the actual pageviews you see in the Analytics UI in Google is normal as the data from the API can have different values. But the top itself should be similar, as the differences are minor.
EDIT: If you still have problems after Top Update, please install the plugin “Temporary Login Without Password” and allow us to debug it further, preferably on a dev site if you have one at hand. You can send the login link to our support e-mail at support[at]presslabs.com.
-
This reply was modified 1 year, 4 months ago by
Presslabs.
Hi,
After setting the month range to date_i18n(‘Y-m-d’, strtotime(‘-1 day’)) and clicking the Update Top button, I still get articles from several months back.
I don’t understand why setting the period parameter in the shortcode to “week” works, but setting the period parameter to “month” and using the same range in the filter function doesn’t work.
I have this code in the filter function. When I use week, it works, but changing to month doesn’t.
‘month’ => date_i18n(‘Y-m-d’, strtotime(‘-7 days’)),
‘week’ => date_i18n(‘Y-m-d’, strtotime(‘-7 days’)),If I set “week” to -1 day, it also works.
It seems that the month parameter in the shortcode is broken in some way.
To sum it up week seems to be the only range that really does work and that we can manipulate to show week, month or day. But we need to different ranges so we’re a little stuck. =/
Hello @cobraeyes,
Based on your feedback I was able to improve the ranges and introduce a DB update feature so it should auto-update the ranges in your database.
Please try out this new plugin version and disable the filter you previously had: https://dl.presslabs.net/temp/toplytics-rc2.zip
It should now have all 3 standard ranges available, monthly weekly and daily. Realtime is still not ready as that uses another API endpoint.
Ok, I have updated the plugin and disabled the filter.
When I use “week” as the period parameter in the shortcode it works.
When I try “today” or “month” no resulting code seems to be displayed. Only the <div> surrounding the shortcode is visible. I also checked the server logs and they show no errors.
Hello @cobraeyes,
How is the data in the feed showing up? Is the JSON feed working? Can you see the top there correctly?
Feed is by default on path
/wp-json/toplytics/results
– this can be changed, enabled or disabled in the settings. -
This reply was modified 1 year, 4 months ago by
- The topic ‘About GA4 Support’ is closed to new replies.