Google Analytics in the use of Flash CS3 tutorial analysis _flash AS3

Source: Internet
Author: User

This is Google's related instructions (http://code.google.com/intl/zh-CN/apis/analytics/docs/ flashtrackingintro.html), we are interested to have a look, I have done a tutorial here to teach you step-by-step use of this component.
I. Apply for a Gmail account
Because this component gets the data that is tied to the account, you need to have a Gmail account.
Open http://www.google.cn/analytics/zh-CN/, select Register Now,
Then select Register Now
Then fill in the information, point ' I accept; create my account '
Then enter the Google Analytics Analysis registration page, choose to register
Fill in the Web site, account name, and select the region and time zone you want to listen to, and then choose to continue
Fill in the last name, first name, phone number (can not fill in), area, and then continue
Tick ' Yes, I agree with the terms ', and then choose to create a new account
Then Google will give you a piece of code, if you copy the code directly to the page you need to listen to, of course, the method described in this article is in the Flash CS3 under the use of Google Analytics components, so we just need to remember one of the IDs, as shown
Note that the box selection in the figure, that is Google to give you an ID, we take ua-7460305-1 as an example, this ID is very important, will be used in the Flash CS3.
Remember this ID, you can point to continue, into the Account page, simple registration completed.
Second, download components
After the registration is complete, we need to download the components in the http://code.google.com/p/gaforflash/downloads/list.
Third, installation components
After extracting the Gaforflash-1.0.1319.zip, create a folder named Google under \program Files\adobe\adobe Flash Cs3\zh_cn\configuration\components , and then copy the ANALYTICS.SWC and ANALYTICS_FLASH.SWC files that you just unpacked into the new Google file.
The note here is that if you are using FLASHCS3, please turn off the Flash CS3 program before installing the components, and so on the above two SWC files are copied to the appropriate location, then start the Flash CS3, select a new one, select, window → components, You can then see the two components we just installed in the palette.
Four, in the Flash CS3 the use
After installing the components, we start using the newly installed components, which is actually calling the class in the component, we take the analyticslibrary component as an example, we do it step-by-step.
1. Drag the Analyticslibrary component to the library panel
2. Then randomly draw a rectangle in the scene and drag it to the library panel, save it as a movie clip, and name it btn in the scene.
3. Then put a dynamic text named Number_txt on the top
4. Then select the first, enter the following code
Import Com.google.analytics.AnalyticsTracker;
Import Com.google.analytics.GATracker;
var _number:int=0;
var tracker:analyticstracker = new Gatracker (This, "ua-7460305-1", "AS3", true);
Btn.addeventlistener (Mouseevent.click, OnButtonClick);
function OnButtonClick (event:event): void
{
_number+=1;
Number_txt.text=string (_number);
Tracker.trackpageview ("/mygame1");
}
Notice the red part, this is the ID that Google has just given us.
5. Then Ctrl+enter test,
Here we point to the middle of the rectangular movie clip, and then we have to listen to the site's clicks are recorded, oh, of course, this data has a few hours of delay, we can see after http://www.google.cn/analytics/zh-CN/landing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.