• Resolved g4rf

    (@g4rf)


    Hi!

    Great plugin we used for the last four years. Now we change our site to a WebApp with only one request (the initial), that get’s all data. So there will be only one site hit per visitor, even if they are viewing more content.

    Is there a documentation for your REST API, so we can trigger a hit from javascript?

    Best,
    Jan

Viewing 1 replies (of 1 total)
  • Thread Starter g4rf

    (@g4rf)

    Solution:
    There is the REST API add on. As we are a non-profit organisation, there are at the moment no capabilities to use a payed plugin.

    Workaround:
    Just call the specific url in an ajax request. It’s not optimal as the server does site generation and this only works without the “use plugin cache” option. But it’s the simplest workaround for now.

    Example with jQuery:

    var url = "/path/to/page/to/record/a/hit";
    jQuery.ajax(window.location.origin + url);
    • This reply was modified 4 years, 3 months ago by g4rf.
    • This reply was modified 4 years, 3 months ago by g4rf.
Viewing 1 replies (of 1 total)
  • The topic ‘Trigger hit rest endpoint from javascript’ is closed to new replies.