Analysis on the use of Google Analytics in Flash CS3

Source: Internet
Author: User

This is a Google-Related Description (http://code.google.com/intl/zh-CN/apis/analytics/docs/flashTrackingIntro.html), you are interested to have a look, I have made a tutorial here, teach you step by step to use this component.
1. Apply for a Gmail account
Because the data obtained by this component is bound to an account, a Gmail account is required.
Open http://www.google.cn/analytics/zh-CN/, select register now,
Then select register now
After filling in the information, click 'Accept; Create My Account'
Go to the Google Analytics registration page and select register
Enter the website address, account name, and region and time zone you want to listen on as required, and then select Continue
Enter the last name, name, phone number (you can leave it blank), and region in sequence, and then continue
Select "yes, I agree to the above terms", and then choose to create a new account.
Then Google will give you a piece Code If you copy this Code directly to the page you want to listen to, you can achieve it. Of course, the method described in this article is to use the Google Analytics component in Flash cs3, so we only need to remember one of the IDS,
Pay attention to the box part in the figure, it is a Google assigned you an ID, we here in the UA-7460305-1 as an example, this ID is very important, will be used in Flash CS3.
After remembering this ID, you can click continue to go to the Account page and complete the simple registration.
Ii. Download Components
After the registration is complete, we need to download the parts at http://code.google.com/p/gaforflash/downloads/list.
3. install components
Decompress gaforflash-1.0.1319.zip and create a folder named Google under \ Program Files \ Adobe Flash CS3 \ zh_cn \ Configuration \ components. copy the SWC and analytics_flash.swc files to the newly created Google file.
Note that if you are using flashcs3 Program Close, wait until the above two SWC files are copied to the corresponding location, then start Flash CS3, choose create one, select one, window → component, then we can see the two components we just installed in the component panel.
4. Use in Flash CS3
After the component is installed, we start to use the newly installed component, which is actually calling the class in the component. Here we will use the analyticslibrary component as an example. We will do it step by step.
1. Drag the analyticslibrary component to the database panel.
2. Draw a rectangle in the scene, drag it to the library panel, save it as a video clip, and name it BTN in the scene
3. Put a dynamic text named number_txt on it.
4. Select the first region and 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 ");
}
Note that the red part is the ID assigned to us by Google.
5. Then press Ctrl + enter to test,
Click the video clip in the middle, and then we will listen for the clicks on the website and we will be recorded. Oh, of course, this data has a delay of several hours. You can refer to http://www.google.cn/analytics/zh-cn/after logging on.

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.