How to Track External Links with Google Analytics — Indivision Interactive Agency
290
post-template-default,single,single-post,postid-290,single-format-standard,bridge-core-3.0.2,qode-page-transition-enabled,ajax_fade,page_not_loaded,,qode-overridden-elementors-fonts,qode-child-theme-ver-1.0.0,qode-theme-ver-28.8,qode-theme-bridge,qode_header_in_grid,wpb-js-composer js-comp-ver-6.9.0,vc_responsive,elementor-default,elementor-kit-856

How to Track External Links with Google Analytics

event-tracking-2

The Problem

By default, Google Analytics treats outbound links to external sites as exits. However, there are often times when it is helpful to track external links separately from other types of exits. For example, if you need to track how many leads a site or link is sending to another site.

A Solution: Track External Links as Events

The key to making this kind of tracking work is to use the Analytics API while staggering the external link so that the API call can complete.

Here is a javascript example of how this can be done:

<!-- JavaScript to be called from the links' onCLick -->

And here is how the link would look:

<a onclick="return trackOutgoingLink(this, 'GOOGLE', 'click');" href="https://google.com">Google It</a>

Using the above method, clicks on the “Google It” link will appear under the “GOOGLE” event category. Read more about Google Analytics events here.

Let us know if you have any questions!

No Comments

Post A Comment