How to sync the Topic view count back to the discourse?

Hey Alex,

I’m curious to learn a little more about this. Anything you can share?

Viewing posts pulled by the WP Discourse plugin doesn’t create new views in Discourse, however if you use the standard show endpoint in the topics_controller, and you pass the check highlighted below, the “view” will be tracked. Note that using an api key will mean there’s a current_user.

Note

One gotcha to note when you’re reading that code is that TopicView is not actually the droid you’re looking for (it’s a model that handles the data serialized when a topic is shown). The actual “topic view” model is TopicViewItem.