I have sent many newsletters, the value of the opened / read emails is always 0%, I have entered several of my emails as members receiving the newsletter, to test this functionality.
With all my accounts I have opened and read the newsletter, the value is always 0%.
@giacomosilli have you checked your logs for any errors? There’s a background job that is started every 5 minutes, you should see some output from it in the logs.
{"name":"Log","hostname":"example","pid":17524,"level":50,"err":{"domain":"https://example.it","message":"Cannot read property 'items' of undefined","stack":"TypeError: Cannot read property 'items' of undefined\n at EmailAnalyticsMailgunProvider._fetchPages (/var/www/ghost/versions/3.39.0/core/server/services/email-analytics/providers/mailgun.js:110:27)\n at process._tickCallback (internal/process/next_tick.js:68:7)"},"msg":"Cannot read property 'items' of undefined","time":"2020-12-07T10:02:14.796Z","v":0}
{"name":"Log","hostname":"example","pid":11017,"level":50,"worker":{"threadId":-1},"msg":"Worker for job \"email-analytics-fetch-latest\" exited with code 1","time":"2020-12-07T10:02:15.815Z","v":0}
Hi @Kevin Still not working for me in 3.39.2. Just a guess, but have you enabled Mailgun EU sending domains? I experienced this problem when first using Mailintel to track Ghost newsletters — they originally only supported US sending domains but fixed it quickly.
@n1n10 if you’re self-hosting then any necessary Mailgun setup would be on you to perform, the only thing Ghost can do is enable the open tracking flag on individual emails when they are created, which is what Ghost does by default from 3.39.0 onwards.
I have two Ghost installations but the the tracking only works on my test site. On my main site it does not.
Looking through my Mailgun logs (related to the Ghost installation where the tracking doesn’t work) I can see alle the opened/clicked events. These are, however, not reflected in the backend of my main Ghost site.
What is even stranger is, that looking through the Ghost logs it seems that the events are actually fetched:
{"name":"Log","hostname":"ghost-techliv","pid":14484,"level":30,"msg":"Fetched 300 events and aggregated stats for 1 emails and 240 members in 2044ms","time":"2020-12-11T10:20:01.789Z","v":0} {"name":"Log","hostname":"ghost-techliv","pid":13943,"level":30,"worker":{"threadId":6},"msg":"Worker for job \"email-analyt ics-fetch-latest\" signaled completion","time":"2020-12-11T10:20:01.794Z","v":0}
Despite this, the open rate in Ghost remains at 0%.
@n1n10 it looks like events (this is all events, not just “opened” events) are being fetched fine so I’d suggest double-checking your Mailgun admin interface to ensure your account is fully set up to support open tracking
Mailgun is tracking all opens and clicks correctly (see attachment) so the problem seems to be in the connection between Mailgun and Ghost.
The only difference between my two Ghost installations is, that I am using a first level domain on the Ghost installation that tracks opens correctly email.domain.com and a second level domain on the one that doesn’t work email.mg.domain.com. The second one is set up with a dedicated Cloudflare certificate.
The final super weird thing is that one of my posts (the very first newsletter sent out after 3.39.0) registered 2 percent open rate (in reality it is much higher) just as I updated from 3.39.0 to 3.39.3. before the tracking stopped working.
@n1n10 can you check your email_recipients table for one of your recent emails to see if it has opened_at timestamps present? If it does then it’s indicating that the aggregation is failing somehow
@Kevin Sorry it went at bit fast. There are nine opened_at timestamps (which equals the 2 percent I mentioned earlier - see attachment with mouse over) 12 failed_at and maybe a couple of hundred delivered_at
Hi @Kevin Just a small update. Saturday afternoon —out of the blue — some of the opening rates began appearing. But it has stopped again. Any idea what causes this?