doublesecretagency / craft-viewcount

View Count plugin for Craft CMS
Other
6 stars 4 forks source link

View counts are zero, despite data being written to db #8

Closed howells closed 4 years ago

howells commented 4 years ago

Hi -

I'm sure I've screwed up somewhere but I can't seem to get View Count to work. I'm calling increment via JS and the relevant info seems to be written to the database:

Screenshot 2020-02-22 at 21 34 07

Yet nothing is returned in the CP:

Screenshot 2020-02-22 at 21 34 44

nor are any views returns in a simply GraphQL query.

I'm not using any keys here.

Any ideas where I'm going wrong?

Dan.

lindseydiloreto commented 4 years ago

Hi Dan,

That's strange, it definitely looks like it should be working. Can you share the Twig code you're using to log views?

One thing that's catching my eye... is the viewKey value being written to the database as NULL, or as an empty string? There is actually a difference.

howells commented 4 years ago

I’ve realised I might be sending and empty string as a key as part of my request (via JavaScript not twig) so I’ll check that in the morning. Thanks for the reply.

lindseydiloreto commented 4 years ago

Sounds great! Let me know if it turns out to be something else.

howells commented 4 years ago

Yeah that was the issue - all working fine now, thanks