Adding Snoobi into a Flash animation (Action script 3)
These instructions are intended for version 3 of Flash's Action Script. Access the instructions for Flash Action Script 1 & 2 here »
To track a Flash presentation or site, call a snoobi.trackPageView(pathParam) function from the animation. This will send the tracking data straight to Snoobi's servers and each action within the animation will be counted as a page view. Hence, the page views will show up under "Pages" in the Snoobi report.
1. Installing the Snoobi tag into the Flash site
The Snoobi tag should be installed normally onto the page containing the Flash animation. Place the Snoobi tag before the closing </body> tag.
2. Calling the snoobi.trackPageView function from the animation
Whenever a particular action is carried out in the animation (a button is pushed, a video is watched, a frame is loaded and so forth) and we want to track it, we call the snoobi.trackPageView(pathParam) function. In practice, trackPageView is a method in a Snoobi object.
The obligatory pathParam –parametre defines the path, which describes the events within the animation. The Snoobi.trackPageView function is a JavaScript-function, which requires an existing external.ExternalInterface library to exist within the Flash. In image 1, said library has been incorporated onto line 3 of the Action Script.
Example 1. An animation located in www.kampanjantekijat.com/flash
Let's say that the animation contains navigation buttons, which will result in a content (i.e. page) change when pressed. In image 1 below, the function showPage has been defined onto line 11 of the Action Script; the showPage makes sure the right page is displayed when the visitor uses the navigation buttons. Also the snoobi.trackPageView function's call has been defined on lines 19-21 of the ShowPage function. In the example, the snoobi.trackPageView function is called as having the pathParameter value "/actionscript3demo/page/"+pathName. In the example, the value of the pathName variable is the same as the page's name in the pages table. As an example, when calling the first page, the pathName variable would receive the value container_1.
In example 1, the Snoobi report will register a page view which URL-address will be www.kampanjantekijat.com/actionscript3demo/page/container_1

Image 1. Calling the snoobi.trackPageView function from within the animation
Here, you may download a Flash-example (.fla), which will illustrate how the tracking ought to work if automated Page names are not used (150 KB). To open the file, you will need Adobe Flash 8 / CS3.
3. Page names from parameter and sectioning from parameter
To enhance the readability of the report, we recommend the use of Automated Page names and Sectioning. Page names help because they replace the page's URL-address with a clear page name in Snoobi's report. Sectioning has many uses, which all aim to group the website content in a manageable manner.
The page names and sectioning from a parameter are carried out by adding the parameters page_name and section into the snoobi.trackPageView function.
Example 2. An animation located in www.kampanjantekijat.com/flash
The Action Script of example 2 is identical to example 1 with the exception that example 2 uses parameters for Page names and sections. In example 2, the snoobi.trackPageView function is still called using the pathParameter's value "/actionscript3demo/page/"+pathName. The new parameters in the snoobi.trackPageView function are the pagename parameter with the value "Flash » Sivu + key" and the section parameter with the value "Demo Flash AS3".
In example 2, a page view named "Flash » Sivu 1" will be registered in the Snoobi report. This page view will also show up in the section called "Demo Flash AS3".

Image 3. Calling the animation's snoobi.trackPageView –function using the page_name and section parameters
Here, you may download a Flash example (.fla), which will illustrate how the tracking ought to work if Page names and Sectioning are in use (144 KB). To open the file, you will need Adobe Flash 8 / CS3.
What is worth being tracked in a Flash animation?
In animations, it can be useful to track all types of actions which may be helpful in determining the quality of a visitor. Here are some examples of good actions to track:
1. Moving within the navigation
- when the visitor clicks / navigates his way to different parts of the Flash animation
2. Submitting forms
- When a form has been submitted successfully. If there are several different forms within the Flash, differentiate them from each other
3. Link clicks
- If the objective of the Flash animation is to direct visitors to pages outside the Flash animation, or if the objective is to encourage visitors to click e-mail links, these can give useful analytics data
4. Watching videos
- which videos are viewed in the animation
- we recommend adding check points to the video, which will reveal how far the video is watched
- the video can be divided in, for example, four different parts. In the beginning of the video and each time a third of the video has been watched, the snoobi.trackPageView function calls a different pathParam value
play button pressed -> snoobi.trackPageView('/video_start')1/3 elapsed -> snoobi.trackPageView('/video_1_3')2/3 elapsed -> snoobi.trackPageView('/video_2_3')3/3 elapsed -> snoobi.trackPageView('/video_end')



