2

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

Houman
  • 64,245
  • 87
  • 278
  • 460
  • How long have you waited for? As far as I know it could take up to 24 hours for the event to be available in the reports (and thus as a goal) Can you check if it is available in the regular report? – Chrisvdberge Oct 10 '18 at 11:27
  • You might be right. Under Behaviour > Events > Overview, there is nothing shown yet. Maybe I need to wait longer. Thanks I'll come back for an update. – Houman Oct 10 '18 at 11:51

1 Answers1

0

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

Chrisvdberge
  • 1,824
  • 6
  • 24
  • 46
  • I have updated the question. While I can now see the event in the report, the goal verification still fails. Any idea why this could be? Thanks – Houman Oct 11 '18 at 06:46
  • Now it works. It seems it takes even longer than a day. :) Happy it works at last. Thanks – Houman Oct 11 '18 at 08:59
  • @Houman thx for the feedback. Good to know it can take even longer than 24 hours ;) – Chrisvdberge Oct 11 '18 at 09:45