This is Google's instructions (/intl/zh-CN/apis/analytics/docs/), if you are interested, you can take a look. I have done a tutorial here to teach you how to use this component step by step.
1. Apply for a Gmail account
Because the data obtained by this component is bundled with the account, you need to have a Gmail account.
Open/analytics/zh-CN/, select Register now,
Then select Register now
Then after filling in the information, click ‘I accept; create my account’
Then go to the Google Analytics registration page and select Register
Fill in the website URL, account name, and select the region and time zone as required, and then select Continue
Fill in your last name, name, phone number (cannot be filled in), and region, and then continue
Hook 'Yes, I agree with the above terms' and choose Create a new account
Then Google will give you a piece of code. If you copy this code directly to the page you need to listen to, it will be implemented. Of course, the method introduced in this article is to use the Google Analytics component under Flash cs3, so we only need to remember one of the IDs, as shown in the figure
Pay attention to the box selection part in the picture. It is an ID assigned to you by Google. Let’s take UA-7460305-1 as an example. This ID is very important and will be used in Flash cs3 later.
After remembering this ID, you can click Continue and enter the account page. The simple registration is completed.
2. Download components
After registration is completed, we need to/p/gaforflash/downloads/listDownload the component.
3. Install components
After unzipping gaforflash-1.0., create a folder called Google under \Program Files\Adobe\Adobe Flash CS3\zh_cn\Configuration\Components, and then copy the analytics_flash.swc file in the newly unzipped package to the newly created Google file.
It should be noted here that if you are using Flashcs3, please close the Flash cs3 program before installing the components. After copying the above two SWC files to the corresponding location, start Flash cs3, select Create a new one, select Window → Components, and then you can see the two components we just installed in the component panel.
4. Use in Flash cs3
After installing the components, we start using the newly installed components here, which is actually calling the classes in the components. Here we take the use of the AnalyticsLibrary component as an example, and we do it step by step.
1. Drag the AnalyticsLibrary component into the library panel
2. Then draw a rectangle in the scene, then drag it to the library panel, save it as a movie clip, and name it btn in the scene
3.
4. Then select the first frame and enter the following code
import ;
import ;
var _Number:int=0;
var tracker:AnalyticsTracker = new GATracker( this, " UA-7460305-1", "AS3", true );
( , onButtonClick );
function onButtonClick ( event:Event ):void
{
_Number+=1;
Number_txt.text=String(_Number);
( "/myGame1");
}
Pay attention to the red part, this is the ID that Google just assigned us.
5. Then Ctrl+Enter test,
Here we click the video clip of the rectangle in the middle, and then we want to listen to the website clicks and it will be recorded. Haha, of course, this data has a delay of several hours, everyone can/analytics/zh-CN/Check it after logging in.
1. Apply for a Gmail account
Because the data obtained by this component is bundled with the account, you need to have a Gmail account.
Open/analytics/zh-CN/, select Register now,
Then select Register now
Then after filling in the information, click ‘I accept; create my account’
Then go to the Google Analytics registration page and select Register
Fill in the website URL, account name, and select the region and time zone as required, and then select Continue
Fill in your last name, name, phone number (cannot be filled in), and region, and then continue
Hook 'Yes, I agree with the above terms' and choose Create a new account
Then Google will give you a piece of code. If you copy this code directly to the page you need to listen to, it will be implemented. Of course, the method introduced in this article is to use the Google Analytics component under Flash cs3, so we only need to remember one of the IDs, as shown in the figure
Pay attention to the box selection part in the picture. It is an ID assigned to you by Google. Let’s take UA-7460305-1 as an example. This ID is very important and will be used in Flash cs3 later.
After remembering this ID, you can click Continue and enter the account page. The simple registration is completed.
2. Download components
After registration is completed, we need to/p/gaforflash/downloads/listDownload the component.
3. Install components
After unzipping gaforflash-1.0., create a folder called Google under \Program Files\Adobe\Adobe Flash CS3\zh_cn\Configuration\Components, and then copy the analytics_flash.swc file in the newly unzipped package to the newly created Google file.
It should be noted here that if you are using Flashcs3, please close the Flash cs3 program before installing the components. After copying the above two SWC files to the corresponding location, start Flash cs3, select Create a new one, select Window → Components, and then you can see the two components we just installed in the component panel.
4. Use in Flash cs3
After installing the components, we start using the newly installed components here, which is actually calling the classes in the components. Here we take the use of the AnalyticsLibrary component as an example, and we do it step by step.
1. Drag the AnalyticsLibrary component into the library panel
2. Then draw a rectangle in the scene, then drag it to the library panel, save it as a movie clip, and name it btn in the scene
3.
4. Then select the first frame and enter the following code
import ;
import ;
var _Number:int=0;
var tracker:AnalyticsTracker = new GATracker( this, " UA-7460305-1", "AS3", true );
( , onButtonClick );
function onButtonClick ( event:Event ):void
{
_Number+=1;
Number_txt.text=String(_Number);
( "/myGame1");
}
Pay attention to the red part, this is the ID that Google just assigned us.
5. Then Ctrl+Enter test,
Here we click the video clip of the rectangle in the middle, and then we want to listen to the website clicks and it will be recorded. Haha, of course, this data has a delay of several hours, everyone can/analytics/zh-CN/Check it after logging in.