Link Tracking

Link Tracking Tests

Right-click and view source on any link to see what the code looks like.


Click to go to the anchor further below.


(555) 555-1234

Data vars test: (555) 555-1234 (custom event example)


Test email (tracked by default)

Data vars test: Test email (custom event)

Custom Attributes

Go to Homepage (simple custom event example)

Go to Homepage (internal-link custom event)

Shop (cta custom event)

Shop (another internal custom event)

Custom Event with Dynamic Link Label —The original data-vars-ga-label is replaced dynamically via JavaScript.


This a test of a self-hosted UTM parameter link.

This is where an anchor link will land

This is some anchor text. Click on Link Tracking > Anchor Tracking in the main menu to get here.

Internal Link (not tracked)

Go to Shop page (internal click not tracked by default)

Outbound Links

Plain link

About caught my eye (outbound link tracked by default)

Link with data-vars-ga-label set

This is an outbound link with data-vars-ga-label set.

This is handy if you’re link text isn’t descriptive.

    This is an 
    <a href="" id="custom-outbound-link" data-vars-ga-label="This is a link that overrides the link text ;-)">
        outbound link
    with data-vars-ga-label set.

This is an image link. The image has alt text set, so the alt text will be used as the event label.

Rocco at Campuhan Ridge
Our beloved Rocco

Custom Social Share Events

Each link below sends a custom event to GA.

Facebook  •  Twitter  •  Instagram

GA realtime results

GA realtime report results for custom social share events.

HTML source code

  onclick="sendSocialClick('Facebook', '');" 

JavaScript souce code

See the JavaScript code on GitHub.