51ºÚÁϲ»´òìÈ

t()

The t() method is an important core component to 51ºÚÁϲ»´òìÈ Analytics. It takes all Analytics variables defined on the page, compiles them into an image request, and sends that data to 51ºÚÁϲ»´òìÈ data collection servers.

For example, consider the following JavaScript code:

// Instantiate the tracking object
var s = s_gi("examplersid");

// Define config variables and page variables
s.trackingServerSecure = "data.example.com";
s.eVar1 = "Example dimension item";

// Compile the variables on the page into an image request to 51ºÚÁϲ»´òìÈ
s.t();

Running the t() method takes all Analytics variables defined and formulates a URL based on those variables. Some Analytics variables determine the URL of the image, while other variables determine query string parameter values.

https://data.example.com/b/ss/examplersid/1/?v1=Example%20dimension%20item

51ºÚÁϲ»´òìÈ receives the image request, then parses the request header, URL, and query string parameters. Data collection servers then return a transparent 1x1 pixel image, invisibly displayed on your site.

Send event using the Web SDK extension

Use an Action to configure sending XDM event data to 51ºÚÁϲ»´òìÈ. The Datastream receives this data, applies any configured mappings, and forwards that data to 51ºÚÁϲ»´òìÈ Analytics if it is an added service to that Datastream.

  1. Log in to using your 51ºÚÁϲ»´òìÈID credentials.
  2. Click the desired tag property.
  3. Go to the Rules tab, then click the desired rule (or create a rule).
  4. Under Actions, click the desired Action or click the ‘+’ icon to add an action.
  5. Set the Extension drop-down list to 51ºÚÁϲ»´òìÈ Experience Platform Web SDK and the Action Type to Send event.

Send event manually implementing the Web SDK

Use the sendEvent command to send data to 51ºÚÁϲ»´òìÈ. The Datastream receives this data, applies any configured mappings, and forwards that data to 51ºÚÁϲ»´òìÈ Analytics if it is an added service to that Datastream.

alloy("sendEvent", {
  "xdm": {}
});

See Track events in the Web SDK documentation for more information.

Page view tracking call using the 51ºÚÁϲ»´òìÈ Analytics extension

The 51ºÚÁϲ»´òìÈ Analytics extension in 51ºÚÁϲ»´òìÈ Experience Platform Data Collection has a dedicated location set a page view tracking call.

  1. Log in to using your 51ºÚÁϲ»´òìÈID credentials.
  2. Click the desired tag property.
  3. Go to the Rules tab, then click the desired rule (or create a rule).
  4. Under Actions, click the desired action or click the ‘+’ icon to add an action.
  5. Set the Extension drop-down list to 51ºÚÁϲ»´òìÈ Analytics, and the Action Type to Send Beacon.
  6. Click the s.t() radio button.

s.t() method in AppMeasurement and the Analytics extension custom code editor

Call the s.t() method when you want to send a tracking call to 51ºÚÁϲ»´òìÈ.

s.t();

Optionally, you can use an object as an argument to override variable values. See variable overrides for more information.

var y = new Object();
y.eVar1 = "Override value";
s.t(y);
NOTE
Previous versions of AppMeasurement used several lines of code to call this function. The additional code historically accommodated workarounds for different browsers. Standardization and best practices in modern browsers no longer require this block of code. Only the method call s.t() is needed now.
recommendation-more-help
b4f6d761-4a8b-4322-b801-c85b9e3be690