Closed shootingandscuba closed 4 years ago
Hi @shootingandscuba, can you provide screenshots of what you're seeing in the plugin?
thanks for looking into this, screenshots attached!
Can you save a copy of the page and send it to us, or right click upon the widget and choose "Inspect Element" and tell us if you see a <table>
element in there? I'd like to know whether the code that's in that widget is successfully outputting the fact that it finds no popular posts, or whether it's failing to output anything at all.
If you have access to your server's PHP error log, any information from there that mentions this plugin would also be of use.
I've added a quick line of code to analytic-bridge.php to email me the output of pagesql and metricsql on execution within the function "query_and_save_analytics"
I get the following SQL queries
PAGE
INSERT INTO wp_analyticbridge_pages
(pagepath, post_id) VALUES
ON DUPLICATE KEY UPDATE id
=LAST_INSERT_ID(id)
METRIC
INSERT INTO wp_analyticbridge_metrics
(page_id,startdate,enddate,querytime,metric,value) VALUES
ON DUPLICATE KEY UPDATE
id
=LAST_INSERT_ID(id),querytime
=values(querytime),value
=values(value)
Reading back through it looks like whatever code runs the condition for generating the value array for each insert is not being met.
Duncan
On 07/09/2017 16:14, Ben Keith wrote:
Can you save a copy of the page and send it to us, or right click upon the widget and choose "Inspect Element" and tell us if you see a |
| element in there? I'd like to know whether the code that's in that widget is successfully outputting the fact that it finds no popular posts, or whether it's failing to output anything at all.
If you have access to your server's PHP error log, any information from there that mentions this plugin would also be of use.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/INN/Google-Analytics-Popular-Posts/issues/72#issuecomment-327830877, or mute the thread https://github.com/notifications/unsubscribe-auth/AeMSDbVLN1i1IPCWwA8aW_ajuFFmOaPoks5sgAhTgaJpZM4PM8X5.
benlk commented 7 years agoCould you log the content of
$report->rows
sometime after the report is fetched from GA, after these lines https://github.com/INN/Google-Analytics-Popular-Posts/blob/d3a5ffccec1902fe158e7f69ba4f708f49e15fdd/analytic-bridge.php#L153-L163 but before thetry ... catch
statement?shootingandscuba commented 7 years agoa var_dump of the $report->rows before the try / catch returns empty
On 15/09/2017 22:23, Ben Keith wrote:
Could you log the content of |$report->rows| sometime after the report is fetched from GA, after these lines https://github.com/INN/Google-Analytics-Popular-Posts/blob/d3a5ffccec1902fe158e7f69ba4f708f49e15fdd/analytic-bridge.php#L153-L163 but before the |try ... catch| statement?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/INN/Google-Analytics-Popular-Posts/issues/72#issuecomment-329907611, or mute the thread https://github.com/notifications/unsubscribe-auth/AeMSDa6Z1K74803zs-UpR5HFW5DbMDtgks5siurngaJpZM4PM8X5.
benlk commented 7 years agoWhat about
var_dump
ing all of $report?That
$report->rows
is empty suggests that something is wrong in the Google Analytics integration. Does your Google Analytics dashboard show any page views?
I've setup the plugin for one site of a multi-site (network) installation as detailed on the setup guide, and I can see requests on the Google Developer side of things, but no data is showing in the plugin. All I get is "Most popular posts from Google Analytics, with a relative weighting average."