Read more about Data Workbench’s End-of-life announcement.
Websites architected using Flash require special attention with respect to the capture of visitor actions performed within the rich media content.
Using Flash ActionScript, you can make simple changes to your existing Flash movies to allow the tracking of all visitor interactions with the movie, such as button clicks or mouse movements.
To facilitate Visitor activity tracking within your Flash movie, please follow the steps listed below:
Add the following ActionScript code to your movie. This code represents a function that can be called by events within the Flash movie that you want to track.
// FLASH TAG CODE BEGIN
var FLASHTAGURI = "[PATH_TO_WEB_SERVER]/flashtag.txt";
function tag(PAGENAME,VARIABLES) {
loadVariablesNum(FLASHTAGURI+”?”+"PAGENAME="+PAGENAME+"&"+VARIABLES,0);
}
// FLASH TAG CODE END
Create a blank file named flashtag.txt and place the file on your web servers.
Within the function in Step 1, replace the [PATH_TO_WEB_SERVER] placeholder with the fully qualified or relative path to the location of the flashtag.txt file. For example:
var FLASHTAGURI = https://www.mysite.com/flashtag/flashtag.txt”;
Add the following ActionScript code to all events to be tracked. This code represents a function call used to capture data about the event:
on(release) {tag("[PUT_PAGE_NAME_HERE]","[PUT_ADDITIONAL_VAR_HERE]");}
This example illustrates the use of the on(release) event; however, the tag() function may be referenced through any event that you may want to track, such as an on(press), on(rollover), on(rollout), or on(keypress) event.
The [PUT_PAGE_NAME_HERE] placeholder should be replaced with a string that represents the name of the page or event that you are tracking. The [PUT_PAGE_NAME_HERE]variable can be modified either manually or through variable reference to denote a unique name for the page or event within the Flash application. The value replacing the [PUT_PAGE_NAME_HERE] placeholder may consist of a simple name or may be structured to represent a hierarchical structure similar to a full URI. For example:
on(release) {tag(“/about_us/index.swf","[PUT_ADDITIONAL_VAR_HERE]");}
Adobe recommends that, prior to code deployment, you compile a written specification for page names and event names to facilitate the alignment of business requirements and development tasks and reduce the potential for additional development cycles.
If desired, additional variables may be collected and associated with pages or events in the Flash movie. To do so, replace the [PUT_ADDITIONAL_VAR_HERE] placeholder with a set of name=value pairs separated by an ampersand (&). For example:
on(release) {tag(“/about_us/index.swf"," var1=value1&var2=value2");}
The variables can be modified either manually or through variable reference to denote additional attributes to be collected and associated with the page or event. If there are no applicable additional variables to collect, remove [PUT_ADDITIONAL_VAR_HERE].
Your setup of visitor tracking within Flash rich media content is now complete. When the event is invoked, the tag (PAGENAME,VARIABLES) function will be called, resulting in an HTTP request being made for the following file. This function will be called in addition to other functions that may be triggered as defined within your Flash movie:
https://www.mysite.com/flashtag/flashtag.txt?PAGENAME=/about_us/index.swf&var1=value1&var2=value2
The HTTP request resulting from the Flash Tag ActionScript function results in the following information being collected with respect to each event within the Flash movie. The last row in the table (W3C Name cs-uri-query) represents the information collected for the additional variables specified in your function call.
W3C Name | Data Collected | Explanation | Example |
---|---|---|---|
x-trackingid | Tracking Identifier (unique visitor) | Identifier read from a cookie placed in the user’s browser by Sensor on Visitor’s initial request | v1st=3C94007B4E01F9C2 |
Date Time |
Timestamp | Time at which request was processed by server (at 100ns precision; accuracy depends on server environment and NTP) | 2002-11-21 17:21:45.123 |
sc(content-Type) | Content Type | Type of object returned from server | Text/html |
sc-status | HTTP Response Status Code | Numerical code generated by the server that notes the status of the HTTP server's response | 200 |
cs-uri-stem | URI Stem | The stem portion of the URI requested by the client | /flashtag/flashtag.txt |
c-ip | Client IP | IP Address of the requesting client | 127.0.0.1 |
s-dns | Server Domain Name | Domain name of the web server processing the request | www.mysite.com |
cs(referrer) | Referring URL | Contents of the HTTP referrer field sent by the client | |
cs(user-agent) | User Agent | Device used to make a request to the HTTP server | Mozilla/4.0+(compatible;+MSIE+6.0; +Windows+NT+5.1) |
cs(cookie) | Client Cookies from Domain | Contents of all of the user’s cookies for the site | KL_TC1 1038058778312 KL972x1038058778312282052 KL_PVKL972 0 |
cs-uri-query | Query String | The query string portion, if any, of the URI requested by the client | PAGENAME=/about_us/index.swf&var1=value1&var2=value2 |