Button no longer works after implementing Google Analytics Event Tracking

Today I installed the google analytics event tracking code into my website to be able to track how many people are clicking the "Purchase ticket" button URL and thus see if our advertisements are effective or not as these pages can only be accessed through specific place this example is for facebook.

I had to Install the Updated Version of the GA Code, Google Tag Manager, and then insert onclick function into my tag.

After successfully implementing it on this page: https://biscuitsandblues.com/popachubbyfb

I had tried to mirror what I had done on a few other pages to continue on, however I ran into a bug where after adding the onclick portion of my code to my next few pages the button was rendered useless and no longer took me to the URL. -> https://biscuitsandblues.com/curtissalgadofb -or- https://biscuitsandblues.com/earlthomasfb

The only difference between in code between the two pages is that the date has changed to reflect the current landing page.

Working button Onclick code:

<div class="ticketbutton">
<a href="https://www.opentable.com/r/biscuits-and-blues-reservations-
02T18%3A30&partysize=2'); return false;"> Purchase Tickets</a>

Please help me figure out this madness! Thank you

I had to go check your trackOutboundLink source on your page, but my only guess is that for cross browser safety, you should change browser.location to window.location

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

0 Comment



Captcha image