1

My Google Analytics reports a bounce rate very high for outbound/javascript:void(0) but I don't understand what this URL is. I use Drupal, and in the HTML code there isn't this URL.

1
  • Can you share the URL of your site with us?
    – Toby
    Commented Nov 29, 2011 at 0:33

1 Answer 1

2

javascript:void(0) is not a URL - it is a way to prevent links from direct loading any URL. Actually this attribute means 'Do Nothing'.

In most cases this is needed when the link calls a JavaScript function on the current page.

In links the href attribute is required : <a href="http://www.example.com">link</a>, but in some cases is needed link to call JavaScript function - this can be achieved with next attribute: href="javascript:SomeFunction();"

The problem is that href attribute cannot forward reference to itself to the called JavaScript function. If for example you need to change clicked link color to red and to change the link innerHTML the easiest way is to use this word as reference to the link itself: <a href="javascript:void(0)" onclick="this.style.color='red';this.innerHTML='This link';">link</a>

So current javascript:void(0) mean that your link is connected to a JavaScript call - this call can do everything - load another page, or site or any JavaScript function. You must look at your JavaScripts to find the reasons why those links affect your site bounce rate.

In Google Analytics you can try to check 'Content' > 'Events' where usually function calls are recorded, just be aware the Google Analytics Events tracking must be activated again via JavaScript on the site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.