• Resolved ansibansi

    (@ansibansi)


    This might be on purpose, if thats the case please dismiss my issue.

    Describe the bug

    We have a crud logic where we have courses with individual course dates that are programmatically creating course-date posts for utilizing wordpress filter logics upon those individual dates. These course dates are not displayed directly but have a post_type_link hook where they get the “parent” course plus a query parameter. so instead of /course-date-1 we have /course?dateid=12345 where 12345 is the course date post id.

    They get listed correctly but are not counted as course date visits. I cant really tell if the page load is added to the /course

    To Reproduce
    Alter the post_type_link in a way where the underlying post is not loaded.

    Expected behavior
    It should count the request not the page load.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Torsten Landsiedel

    (@zodiac1978)

    Hi @ansibansi

    which tracking method are you using? Default or JS based (with or without nonce check)?

    If both are not working, you maybe could use the statify__visit_savedfilter to achieve the tracking you need to get.

    Thread Starter ansibansi

    (@ansibansi)

    Its default no js, thanks already for your help on this!

    I can definitely look into this later, but maybe you are faster with answering two questions:

    Do you think of utilizing statify__visit_saved in combination with checking the current request? or is the call somehow delegated from the page call and you think of something else?

    Is it possible to override the referrer with non-url data or could that cause problems anywhere else?

    Plugin Support Torsten Landsiedel

    (@zodiac1978)

    Do you think of utilizing statify__visit_saved in combination with checking the current request? or is the call somehow delegated from the page call and you think of something else?

    The first. You need to look at the target URI and get the parameter from it and the act accordingly (whatever you want to achieve).

    Is it possible to override the referrer with non-url data or could that cause problems anywhere else?

    This is not possibly. The referrer gets sanitized/checked for URLs and will not work with other data. But I already linked you a gist with my attempt to track additional data in a new column. Maybe you could use this approach to track your data:
    https://gist.github.com/Zodiac1978/a4796579f5143d9e3100015e664adc2c

    Or you try one of the other solutions which offer query parameter tracking in their Pro versions, mentioned here:
    https://github.com/pluginkollektiv/statify/issues/221#issuecomment-2443885534

    Plugin Support Torsten Landsiedel

    (@zodiac1978)

    Marked as resolved due to inactivity. Feel free to mark as unresolved again and ask further if anything is still missing!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘post_type_link hook without page load prevents counting’ is closed to new replies.