Mobile app version of vmapp.org
Login or Join
Heady270

: Tracking a sale with Google Analytics I have created an infographic for my website. When the infographic is shared (via blogs, social media etc), the person sharing will be required to back

@Heady270

Posted in: #GoogleAnalytics

I have created an infographic for my website. When the infographic is shared (via blogs, social media etc), the person sharing will be required to back link to a landing page on my website. E.g. mywebsite.com/this-page

The landing page will provide information about events that I'm selling. Once they have reviewed the information, they can click through to a calendar. The calendar will list the events. Each event will have it's own page outlining information with a link to purchase tickets. This link goes to a third party events site (regonline.com).

If the user has come from my infographic link, explores the site and then goes to purchase tickets via the third party link, is it possible to track the sale via Google Analytics?

Hopefully that all makes sense!

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Heady270

2 Comments

Sorted by latest first Latest Oldest Best

 

@Cody1181609

Using Javascript

Important bit is that you can not just attach a click handler to a link where you send the adsense event. This way sending the event would be unreliable because sometimes the browser loads the new page before sending the event, sometimes not.

You have to use hitCallback. The following example is taken from google analytics docs.

<script>
var trackOutboundLink = function(url) {
ga('send', 'event', 'outbound', 'click', url, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}
});
}
</script>

<a href="http://www.example.com"
onclick="trackOutboundLink('http://www.example.com'); return false;"
>Check out example.com</a>


Problem with this solution is, that if for some reason the hitCallback is never received (think Browserbugs or adblockers), the user gets never redirected and you might loose a possible sale.

Without Javascript

Yes, I now you require JS for sending the events anyway. However, if you want to trigger the sending of the event without JS (because you really do not want to loose a sale because for some stupid adblocker or browser bug) you could use a plain old meta tag redirect page.

The "sale" link goes to a page with some js sending the analytics event and redirecting the user to the sales page.

But be sure to wait some time for the redirect to enable analytics to send the request. If loading the analytics code does take longer than you did wait before redirecting the event will be lost, but the customer is still redirected to the sale page.

10% popularity Vote Up Vote Down


 

@Samaraweera270

You can track the outbound links as an event and then set a goal with that event.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme