track().outlink

The track().outlink() method records clicks on links to external websites or apps (different domains).

Syntax

TrackHelper.track()
  .outlink("outlink")
  .with(getTracker());
TrackHelper.track()
  .outlink("outlink")
  .with(tracker)

Parameters

outlink (string, required)

The outlink. Example: https://example.com.

Examples

To track an outlink to https://example.com:

Tracker tracker = ((PiwikApplication) getApplication()).getTracker();
TrackHelper.track()
  .outlink("https://example.com")
  .with(tracker);
val tracker: Tracker = (application as PiwikApplication).tracker
TrackHelper.track()
  .outlink("https://example.com")
  .with(tracker)