• Resolved wordmax

    (@wordmax)


    Just curious, is there a reason why you have the script loading before the <title> in the page/post code? Most other scripts run after all the basic html meta is loaded in the <head>

    <script>window.koko_analytics={"tracker_url":"https:\/\/mywebsite.com\/koko-analytics-collect.php","post_id":0,"use_cookie":1,"cookie_path":"\/","honor_dnt":!0}</script>

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wordmax

    (@wordmax)

    Sorry somehow this posts got posted w/ wrong info.

    Is there a reason the plugin code script is running before the html title in the code? Most other add on plugins/codes run after the primary html data before the closing head tag.

    Thanks

    Plugin Support Lap

    (@lapzor)

    The Koko script isn’t actually doing the tracking before the title. That 1 line of Javascript code you find there contains the settings for Koko.

    The Koko script itself runs in the end just before the </body>

    I’m not 100% sure why it’s in the header, would have to ask Danny about that, but I assume it’s to make 100% sure that those settings are available to koko by the time the koko script itself executes as it can be tricky to control in what order WordPress loads plugins/scripts.

    Anyway, it won’t slow down your site as it isn’t doing any work yet when it’s loading the settings.

    Hope that helps. If you have any questions, please let me know!

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

The topic ‘Why does script load before in the’ is closed to new replies.