Search code examples
google-analyticsgoal-tracking

How to set a goal in google analytics based on 'outbound click' events?


Tracking outbound links and forms can be tricky because most browsers will stop executing JavaScript on the current page once a new page starts to load.

This can be mitigated by setting 'transport': 'beacon'.

According to this support page, which I have followed, I have been able to set this up correctly.

<script>
var trackOutboundLink = function(url) {
   ga('send', 'event', 'outbound', 'click', url, {
     'transport': 'beacon',
     'hitCallback': function(){document.location = url;}
   });
}
</script>

And my links do this:

<a href="http://www.example.com" onclick="trackOutboundLink('http://www.example.com'); return false;">Check out example.com</a>

When I test click on it, I can see it registered on RealTime > Events:

enter image description here

And yet when I try to set a goal the event is not seen:

Admin > Goal > new Goal > Custom > Event > Goal Details set to outbound and click:

enter image description here

And yet when I click on verify goal, it says nothing like has been found in the last seven days. I have waited for many hours and still nothing is seen, even though the real-time event is seeing the clicks.

What am I missing, please?

UPDATE:

After waiting for 24 hours, I can see the event showing up in the report section. However, the goal verification still can't see it.

enter image description here


Solution

  • If it is not available in the regular reports either it most likely is a matter of waiting a bit longer. It can take up to 24 hours for events to show up in reports.

    Please let us know if that was indeed the problem