← Guides·Adobe Analytics

Adobe Analytics

linkTrackVars, s.tl() and success events in Adobe Analytics

How s.tl() sends custom, download and exit links, why linkTrackVars and linkTrackEvents drop events, and how to set up each success event type.

David PombarSwiss army knife at Trackingplan
12 min read · 2600 words

A custom link call in Adobe Analytics sends only what you allow it to send. That is the whole job of linkTrackVars and linkTrackEvents, and it is why a click can arrive in Adobe with its link name and without the event you built the rule for. This guide covers s.tl(), the two filters, the success event types and the settings that stop double counting. It is part of our Adobe Analytics guide for digital analysts; for the full implementation, from report suite to publishing, start with the Adobe Analytics implementation guide.

Every platform fact here comes from Adobe’s documentation, linked in each section.

What s.tl() sends

s.tl() is the AppMeasurement method for a link tracking call: a hit that is not a page view. A carousel click, a PDF download, an outbound link to a partner, a form step. Link calls do not add page views, and that is the point: a click sent with s.t() would count as a page view.

The syntax, from Adobe’s reference for the method:

s.tl([link object], [link type], [link name], [override variables]);
ArgumentRequiredWhat it does
Link objectYesDecides whether the browser waits before leaving the page (this or true)
Link typeYesOne character: o custom, d download, e exit
Link nameRecommendedThe value of the Custom link, Download link or Exit link dimension; without it, Adobe uses the linkURL variable
Override variablesNoAn object that changes variable values for this one call

The link type decides which report the click lands in. In the request it shows up as pe=lnk_o, pe=lnk_d or pe=lnk_e, with the link name in pev2 and the URL in pev1, as Adobe’s data insertion variable reference lists.

A minimal custom link:

s.tl(true, "o", "pricing toggle annual");

Name links for the report, not for the code. "pricing toggle annual" reads well in a Workspace table six months later; "btn_click_3" does not.

this, true and the 500 ms wait

The first argument exists because a link that leaves the page can kill the request before it goes out.

Use this on a real <a> element that navigates. Use true when the call is not tied to a navigation: a toggle, a tab, a video start, a call from a data layer listener.

The wait matters less than it did. Adobe’s note on the method says AppMeasurement turns on useBeacon for exit links automatically (Adobe’s useBeacon page has the details), which sends the hit with navigator.sendBeacon(), so the argument is no longer needed in modern browsers. For a download or custom link that navigates, you can set s.useBeacon = true before the call; it resets to false after each hit.

linkTrackVars is the list of variables a link call is allowed to carry. Whether s.tl() sends everything on the s object or almost nothing depends on it.

From Adobe’s reference page for the variable:

s.eVar1 = "footer";
s.eVar2 = "logged in";
s.linkTrackVars = "eVar1";
s.tl(true, "o", "newsletter signup");
// The hit carries eVar1. eVar2 has a value but is not on the list, so it stays behind.
Diagram in three columns. On the left, a rule sets eVar7, eVar9 and the events event20 and event21, sets linkTrackVars to eVar7,events and linkTrackEvents to event20, then calls s.tl. In the middle, three checks: the value is set, its name is in linkTrackVars, and for events, it is listed in linkTrackEvents. On the right, the hit Adobe receives: eVar7 and event20 are sent, eVar9 fails check 2 and event21 fails check 3. A band says an empty linkTrackVars sends every variable and None sends none.
Every value on a link call passes the same checks. Events have one more than eVars and props.

linkTrackEvents and the event that never arrives

linkTrackEvents does for events what linkTrackVars does for variables. It takes a comma-delimited list of event names, again without s.: "event1,event2,event3,purchase".

Adobe’s reference page for it sets three conditions for an event to reach a link hit:

  1. The event is set in s.events.
  2. The word events is in linkTrackVars.
  3. The event is listed in linkTrackEvents.

The common bug is a rule that meets two of the three. Adobe’s own example shows the effect:

s.events = "event1,event2";
s.linkTrackVars = "events";
s.linkTrackEvents = "event1";
s.tl(this, "o", "Example Custom Link");
// Only event1 is sent. event2 is set but not in linkTrackEvents.

The other variant: linkTrackEvents = "event20" is there, but linkTrackVars = "eVar7" forgot events. The call goes out, the link name shows up in the Custom link report, the eVar is set, and the success metric stays at zero. Nothing errors.

Two more things from the same docs:

A wrapper keeps the three lists in step:

function trackLink(name, vars, events) {
  var names = Object.keys(vars);
  names.forEach(function (key) { s[key] = vars[key]; });
  if (events) {
    s.events = events;
    s.linkTrackEvents = events;
    names.push("events");
  }
  s.linkTrackVars = names.join(",");
  s.tl(true, "o", name);
}

trackLink("homepage carousel click", { eVar7: "position 3" }, "event20");

One function writes the variables, the events and both lists, so a new event cannot be added in one place and forgotten in the other.

Success events: counter, numeric and currency

A success event is a metric you define, set through s.events. Adobe calls them success events, conversion events or custom events; they are the same thing. You enable each one under Admin > Report Suites > Edit Settings > Conversion > Success Events, as Adobe’s report suite admin documentation explains. Most organizations on non-legacy contracts have 1,000.

The Custom Success Events table in Adobe Analytics report suite settings, with columns for Event, Name, Type, Polarity, Visibility, Description and Unique Event Recording. Five rows from event1 to event5 show types Counter and Currency and visibility options.
Screenshot: the Custom Success Events settings of a report suite. Image: Adobe, Experience League

There are three types:

TypeWhat it recordsHow you send it
CounterThat something happened. The default for a new events.events = "event1"; counts one. s.events = "event1=10"; counts ten
NumericA number that is not money, such as coupons used in an order. Accepts decimalss.events = "event2=4.5";
CurrencyAn amount of money, such as tax or shipping. Adobe converts it to the report suite currency when the two differs.events = "event3=12.99";

The value syntax comes from Adobe’s events reference. Pick the type before the event collects data. Switching between counter and numeric keeps what was captured; switching to or from currency does not keep historical data available in reporting.

Three settings in the same table change how the event behaves:

s.events is case-sensitive. Event1 is not event1, and Adobe does not record it.

Event serialization: count once per ID

A thank-you page that fires a lead event on load counts again on every refresh. Event serialization is Adobe’s answer, described in Adobe’s event serialization page.

  1. Set the event’s Unique Event Recording to Use Event ID in the report suite settings.
  2. Send an ID with the event, after a colon:
s.events = "event1:LEAD8812";
s.events = "event1:LEAD8812,event2:LEAD8812";

The rules:

If you only need one count per visit and have no ID, Record Once Per Visit needs no code change.

The purchase event and purchaseID

purchase is a standard event, not a custom one. According to Adobe’s purchase event reference, one purchase adds one Order, adds the quantities in s.products to Units, and adds the prices in s.products to Revenue. Adobe does not multiply price by quantity, so the price field carries the total for that line.

s.events = "purchase";
s.products = ";Running shoe;2;179.98";
s.purchaseID = "ORD10442";
s.t();

Do not serialize purchase with a colon. Use s.purchaseID, which Adobe’s purchaseID reference describes like this:

Without purchaseID, Adobe builds a temporary ID from the hit and keeps the last five per visitor, which catches a refresh but not much else. The other standard commerce events (prodView, scOpen, scAdd, scRemove, scView, scCheckout) work with s.products the same way. Product-level currency or numeric events go in the fifth field of s.products, separated by pipes; Adobe’s examples also list the event in s.events:

s.events = "purchase,event5";
s.products = ";Running shoe;1;89.99;event5=4.99";

With the Adobe Analytics extension, a custom link is a rule whose action is Send Beacon with the s.tl() option selected, plus the link type and name. You cannot set the optional arguments there, and the extension fills in linkTrackVars and linkTrackEvents from the variables and events set in the interface, not from custom code.

With the Web SDK, there is no s.tl() and there are no filter lists. Adobe’s method reference says the Web SDK does not tell page views and link calls apart: both are sendEvent. A payload is a link call when it carries a link type:

alloy("sendEvent", {
  xdm: {
    web: {
      webInteraction: {
        name: "homepage carousel click",
        URL: "https://www.example.com/sale",
        type: "other" // other, download or exit
      }
    }
  },
  data: {
    __adobe: {
      analytics: {
        eVar7: "position 3",
        events: "event20"
      }
    }
  }
});

With the data object, the link fields are data.__adobe.analytics.linkName, linkURL and linkType, with the values o, d and e. Adobe also warns that if you set events in the data object, the events in the XDM object are overwritten.

The Web SDK does not exclude fields from link calls the way linkTrackVars does. To control what a click carries, Adobe points to the onBeforeEventSend callback, where you clear or set fields before the event leaves. When moving a custom link rule from the Analytics extension, Adobe’s migration guide moves the variables, the link name and the link type into one Update variable action, then adds a Send event action.

Adobe Tags action configuration for a rule called Navigation click. The extension is Adobe Experience Platform Web SDK, the action type is Update variable, the analytics object is selected, and the Event field is set to event10, next to the Event ID and Event value fields.
Screenshot: an Update variable action in Adobe Tags setting event10, with the optional Event ID and Event value fields. Image: Adobe, Experience League

AppMeasurement can track downloads and exit links on its own, through trackDownloadLinks and trackExternalLinks and the filters that go with them. If those are on and you also call s.tl() for the same clicks, Adobe sends both. Adobe’s tl() page suggests checking s.lt() first and sending the manual call only when it returns an empty string:

function trackDownload(obj) {
  var lt = obj.href != null ? s.lt(obj.href) : "";
  if (lt == "") {
    s.tl(obj, "d", "spring brochure pdf");
  }
}

Decide per link: automatic or by rule. Both is how the Download link report doubles after a redesign.

Open the network tab or the Adobe Experience Platform Debugger, click, and read the request that goes to /b/ss/:

Check it once in staging and you know it worked on the day you tested. The rule breaks later: a release renames the CSS class the trigger listens to, someone moves an event into custom code, a new consent banner delays the library. The Custom link report keeps filling, so nobody notices the metric is gone. The full debugging routine is in how to debug Adobe Analytics.

Trackingplan watches every event and property your real users send to Adobe Analytics and flags missing properties, dead tags, duplicate fires, and broken triggers on real traffic, so a link call that loses its event shows up after the release that broke it. It installs from the Adobe Experience Platform tab; the steps are in the Adobe Experience Platform install doc.

FAQ

What does linkTrackVars do in Adobe Analytics?

It is a comma-delimited list of the variables AppMeasurement includes in an s.tl() link call, written without the s. prefix. A variable reaches the hit only if it has a value and is on the list. Empty or undefined sends every variable; "None" sends none. Page views made with s.t() ignore it.

Why is my event missing from an s.tl() call?

Three conditions must all be true: the event is set in s.events, the word events is in linkTrackVars, and the event itself is in linkTrackEvents. Most missing events fail the second or third condition. In the Adobe Analytics extension, an event set in custom code has to be added to both lists in custom code too.

The link type is one character: o for a custom link, d for a download link, and e for an exit link. In the hit it arrives as pe=lnk_o, lnk_d or lnk_e, and the link name arrives as pev2.

What is the difference between this and true in s.tl()?

With this, AppMeasurement waits up to 500 ms before the browser follows the link, so the image request has time to go out. With true, it does not wait. Adobe notes that AppMeasurement turns on useBeacon for exit links automatically, so the argument is no longer needed in modern browsers.

What types of success events does Adobe Analytics have?

Counter, numeric and currency. Counter events record that something happened and are the default. Numeric events add a number that is not money, and currency events add an amount that Adobe converts to the report suite currency. Switching to or from currency does not keep historical data available in reporting.

How do I stop an event from being counted twice?

Set the event’s Unique Event Recording to Use Event ID and send an ID with it, as in event1:ABC123. IDs are alphanumeric, up to 20 bytes, and never expire. For the purchase event, use the purchaseID variable instead.

David PombarSwiss army knife at Trackingplan

Read more from David, a Senior Product Strategist with 18+ years in digital product development and an atypical error detection knack.

Trackingplan

See everything. Miss nothing.

Your implementations audited around the clock with real-time, real-user data. Real-time alerts about errors or changes in your data, campaigns, pixels, privacy and consent. Let AI flag issues before they cost you.