Retriving click rates via Admin API

I’ve been looking into creating my own backend setup for an automated onboard sequence (see previous discussion). Currently the plan is to use labels on users to track where they are in the sequence, and create and send a duplicate of each email in the sequence to the labelled segment.

This will create a lot of duplicate posts, so I plan to have a cleanup that runs every X days, pulls the email statistics (eg number of opens) from the duplicate post to store somewhere and then deletes the duplicate.

I notice Ghost now tracks clicks and other things like conversions and feedback response (which is awesome, thank you so much) and offers CSV export of that. The page also states that you can see which post a member converted on in the Member management. However, this new data doesn’t seem to be reflected in the example post response in the Admin API, or in the Member or Subscription objects.

My plan is still very early stages, so I don’t have a Mailgun instance to test against. Is this new analytics information available in the Admin API? Thank you.

(Also FYI the link on setting a custom source in that Post analytics page 404’s)

I’d take a look at what the admin API is doing when you access those stats in /ghost. Open dev tools (F12), go to the network tab, and look at the endpoint and payload.

(This is seriously my best tip for all sorts of API work. Since the Ghost Admin page at /ghost is basically just making API calls, you can learn to do what it does just by copying it!)

2 Likes

That’s a great tip, thanks!

I have noticed that the API docs mark some elements as experimental, and the network seems to be querying endpoints that aren’t documented (such as member/events) to pull the statistics. So I guess my question shifts to whether there are plans to expose these as stable endpoints in the docs in future.

The members endpoints are relatively new. I’m sure they’ll be stable and documented at some point. :)

1 Like

Ahh, I didn’t realise they were new. Thanks for your insights. :)

1 Like