SEO, bounce rate and Google analytics javascript

  • I'm just getting my head under the hood of KRPano, but because you guys understand what you're talking about, you tend to only include snippets of code in your posts, which makes it difficult to understand the overall structure of KRPano, webpage, xml and javascript, and how they interact. Are there any well commented tutorials that describe tackling all of these on a single page and the interation between them? I need to see the entire solution so that I can understand it. I'm pretty dense.

    I'm working on a new website, and the SEO landscape has changed somewhat since I last did any scripting/coding. Bounce rate appears to be a consideration for Google, and a tour, whilst possibly engaging your visitor for several minutes, may then result in a bounce if they don't click through to another page on your site. To me, with my limited knowledge, it looks almost essential to send the pano loading events to GA so that they can see interation is occuring on the page and prevent a single page load being considered a bounce.

    Am I mistaken in this assumption? Do you send mousedown or pano loaded events to GA or rely on visitors hitting a second page on your website? Is it even a consideration?

    So how do I get a thumbnail click in a virtual tour sent as an event to GA? I have spent hours trawling the site and forum, and whilst I have found the relevant javascript I still can't see where it goes or the bigger picture of how it all works together.

  • An easy way to add custom events to some UI elements might be using a <style> and 'addevent'.

    E.g. create such style anywhere in the xml:

    Code
    <style name="ga"
      onclick.addevent="js: ...do your Google-Analytics Javascript calls..."
      />

    and add that style to all elements you want to track:

    Code
    <layer ... style="...|ga" ...


    Inside the Javascript code you can use the 'caller' Object to get information about the current element (e.g. caller.name).

    Something similar can be used also for the global events - create an <events> element and call there your Google-Analytics Javascript code:

    Code
    <events name="ga" keep="true"
       onnewpano="js: ..."
       onclick="js: ..."
       ...
       />


    More information:
    https://krpano.com/docu/xml/#style
    https://krpano.com/docu/xml/#addevent
    https://krpano.com/docu/actions/#jscode
    https://krpano.com/docu/xml/#events

  • Thanks for that, Klaus.

    How do I intercept the mousedown on the individual thumbnails within your player?

    Can this be perfomed by including javascript within the xml?

    How do I target each individual thumbnail? Is there any way I can expose the structure of the thumbnails to see their ID's?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!