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:
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
:
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.
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