Event + hitCallback (through GTM)

247 views
Skip to first unread message

Álvaro Verdeja Junco

unread,
Feb 15, 2013, 2:22:22 PM2/15/13
to google-analyti...@googlegroups.com
I have an e-commerce (Magento) website. On the cart page, at the proceed to Checkout button, I have the following event:

dataLayer.push({'checkoutURL':'http://www.mydomain.com/es/onestepcheckout/','event':'proceedCheckout-click'});

When the users clicks, the following tag should by fired:

<script type="text/javascript">
ga('send', 'event', {
  eventCategory: {{pageType}},
  eventAction: {{event}},
  eventLabel: {{basketQuantity}},
  eventValue: {{basketTotal}},
  hitCallback: function() {
    window.location={{checkoutURL}};
  }
});
</script>

Now... when the user clicks it's redirected to the checkoutURL.

If I remove the hitCallback function, nothing happens, so I understand that the event is stored at Analytics and then the user is redirected.

The problem is that I have mucho more visits to the checkoutURL (coming from the cart -navigation summary-) than events for it.

Can you help me?

Similar happens on the add to cart button :s
Reply all
Reply to author
Forward
0 new messages