The bufferRequests()
method allows you to cache image requests on the current page instead of sending them to Adobe. Triggering this method is useful in scenarios where a browser doesn’t support navigator.sendBeacon()
or otherwise cancels image requests when a page unloads. Many versions of WebKit browsers, such as Safari, commonly exhibit the behavior of stopping an image request when clicking a link. The bufferRequests()
method is available on all versions of AppMeasurement v2.25.0 or later.
When you call t()
or tl()
on a subsequent page in the same browser session and bufferRequests()
was not yet called on that page, all buffered requests are sent in addition to that page’s image request. Buffered requests are sent in the correct order, where the current page’s image request is sent last.
The timestamp of buffered requests is shared with the page that data is sent. If you want more precision in the exact second a buffered request is recorded, you can set the timestamp
page variable before buffering the request. If you use this variable, make sure that Timestamps optional is enabled - if it is not, all timestamped hits are permanently lost!
When calling the bufferRequests()
method, keep in mind the following limitations. Since this method uses Window.sessionStorage
, many of the same limitations apply:
t()
or tl()
without calling bufferRequests()
first, or until the browser or tab is closed. If a browser session ends before you can send that data to Adobe, unsent buffered requests are permanently lost.t()
method.The Web SDK currently does not offer the ability to buffer requests.
There is not a dedicated field in the Adobe Analytics extension to use this variable. Use the custom code editor, following AppMeasurement syntax.
Call the bufferRequests()
method before calling t()
or tl()
. When bufferRequests()
is called, subsequent tracking calls are written to session storage instead of sent to Adobe data collection servers.
// Instantiate the tracking object
var s = s_gi("examplersid");
// Flag the request to be buffered
s.bufferRequests();
// The t() or tl() method then writes the data to session storage instead of sending it to Adobe
s.tl(true,"o","Example link click");
// On a subsequent page, the tracking call sends both the above link tracking call and the page view call
s.t();