0

In my website we have a banner which on clicking directs the user to our client's website. In order to track the number of people clicking the banner we decided to make use of the google analytics events component. I added the JS provided by them just below my Google analytics script.

var captureOutboundLink = function(url) { ga('send', 'event', 'outbound', 'click', url, { 'transport': 'beacon', 'hitCallback': function(){document.location = url;} }); }

Then in the place of the banner I called the function

<a href="https://example.com/pg/" onclick="return captureOutboundLink('https://example.com/pg/');">
<img src="https://www.moreexample.com/admin/banner/mascot.jpg" alt="macott2022" title="macott2022" class="img-res innerbann" />​

But the google analytics events tab is still not tracking. I tried clicking the Banner few times but it shows no signs of activity. Does it take time to reflect ? ​

1 Answers1

0

yes, events report might need some time to process the data. you can use "events" section of real-time report instead. moreover you might use Tag assistant or other GA debugging tool to make sure that your event data being sent.

Дмитро Булах
  • 3,697
  • 1
  • 14
  • 23