3DSTATS CODE


I) Code for HTML, PHP, C or C++, ASP Website
    1) How to add the 3dstats HTML code
    2) How to customize the tracker name
    3) How to customize the tracker URL
    4) 3dstats code for SSL Pages
    5) Detection of SSL and no SSL Pages
    6) Web Html Editors instruction

II) 3dstats Code for Flash-Based web sites
    1) The main code (flash-based website)
    2) Trackink pages: ActionScript Code (flash-based website)
    3) Trackink exit links: ActionScript Code (flash-based website)


3DSTATS HTML CODE


3DStats.com gives you the possibility to track your entire Web Site. 3dstats can track until 64000 unique pages per account ! The 3dstats HTML code is able to automatically detect the name(s) and the URL(s) of your pages. A special code is available for tracking your SSL pages.

How to start:

You need to place the 3dstats HTML code into your Web site Pages. You can find this HTML code by editing your 3dstats Account. Push the button : "3dstats code"

How to add the 3dstats HTML code.

With our implementation software tool, this process can be performed automatically (static page).
You can download it here.


If your site is coded in PHP or ASP, you can easily insert the code in an include file. ( footer file or other)

Example of 3dstats code :


1) Select the code in box by clicking on "HIGHLIGHT ALL".

2) Press Ctrl-C to copy the selected text. Make sure you copy the entire piece of code.

3) Open the HTML page you want to track in a text editor. If you use a web page editor, please read below for special instructions.

4) Press Ctrl-V to paste the copied code into your web page. Make sure you copy the code after the <BODY> tag and before the </BODY> tag. Note If your are using the Exit link (or Adsense) tracking feature, you must paste the 3dstats code after the Google Adsense code or after the links that you want track. A good idea is to paste the 3dstats code just before the </body> tag.

5) By default, 3dstats will use the first 150 characters of the text inserted between the <TITLE> </TITLE> tags to detect the name of your page, so if you have no <TITLE> tags or your pages or titles are not correcty defined, you will have to replace the "DetectName" string that is found within the code with a unique name for the page. Please read below "How to customize the 3dstats HTML code" for more informations.

IMPORTANT : If you do not have unique <TITLES> tags on your pages and do not have the time to customize the code, you will have to change the detection method used by 3DSTATS. To do so, edit your account, and select the 'URL' option in the "Pages Detection Method" field. After this change, 3dstats will use the URL of your pages to identify them.

6) Save your web site page.

7) Upload your page on your web site server.

Repeat these steps on every page you want to track.

How to customize the 3dstats HTML code. 

1) Define your Page Name : (Optional)

By default, 3dstats will use the text inserted between the <TITLE> </TITLE> tags as the page name. If you want to change the name of the page, you need to replace the text "DetectName" in the line:
var P="DetectName";
with the name you want to attribute to this page. Be sure to leave the quotes around the page name text.

For Example :



If your site is coded in PHP or ASP, you can define your own PHP variable.

For example in PHP.
$PageName="mypage";


in the include file with the 3DStats code:
print ("var P=\"$PageName\"");


2) Change the URL of the Page  (Optional)


If you want to change the URL of the page, you need to replace the text "DetectUrl" in the line
var U="DetectUrl";
with the desired URL. Be sure to leave the quotes around the URL.

For Example :




3) Tracking the SSL Pages  


3dstats SSL code is specifically designed to track traffic on SSL (Secure Socket Layer) pages. SSL code should go into any page that resides in a secured directory or server. The box with the 3DStats SLL code is displayed below the normal code.



How to change the 3Dstats normal code in SSL code:
Replace in the 3dstats code http://www.3dstats.com/cgi-bin... by https://www.3dstats.com/cgi-bin... and "3dstrack.cgi" by "3dstrackssl.cgi" on your SSL pages

Tracking the SSL Pages automatically 

You can do this easily in PHP or in ASP. However, a javacript code is availabe on the 3dstats codes page.




3DSTATS CODE For Flash-Based Website


3Dstats can track flash-based web sites with a special javascript code.You have to paste This code into the index HTML Page where the Flash program is embedded (.swf file). In flash-based web sites, the buttons are used to direct visitors to the different pages of the site, this code will be called with the GetURL ActionScript command when a button (or object) will be clicked. To detect the click, you can use the on release function.

You will find here a small flash-base website tutorial. You can download the source (.fla file) here

a) Code on the index page: You have to copy the 3dstats code flash-based website into the index HTML Page where the Flash program is embedded (.swf file).



b) Tracking the pages visited with actionscript For each button (navigation) we have to call the javascript TrackFlash(name_of_destination_page) function with the actionscript GetUrl Command.


c) Tracking Exit links with actionscript For each exit link we have to call the javascript FlashExitLink(url_of_the_exit_link) function with the actionscript GetUrl Command.







WEB HTML EDITORS

A number of HTML editors actually modify your HTML code and can break JavaScripts. Please find here some special instructions to copy the html code.

Front Page & Front Page Express
In Design View (default view)
Click on bottom of page.
Click insert > HTML Markup (in menu bar).
Paste copied code into text box.
Click "OK".

Front Page 2000
In Design View (default view)
Click on bottom of page.
Click insert > Advanced and select "HTML".
Paste copied code into text box.
Click "OK".

HotDog Pro
Paste copied code anywhere between <Body> and </Body> tags.
Ignore red highlighted code errors.
Do not attempt to edit any code!

Dreamweaver
In Design view: Paste copied code anywhere in the design view.
In HTML view: Paste copied code anywhere between <Body> and </Body> tags.
Ignore broken image tags.

HotMetal Pro
Paste copied code anywhere between <Body> and </Body> tags.
Ignore red highlighted code errors.
Do not attempt to edit any code!

Net Objects Fusion
Right click in layout.
Click "Layout HTML".
Click "Beginning of Body" tab.
Paste copied code
Click "OK".

Visual Page 2.0
Go to view > source ( in menu bar).
Paste copied code anywhere between <BODY> and </BODY> tags.
Return to Page View (view > page).
Ignore all extraneous code on page. (It will not affect how the page displays in a browser.)
Do not edit or delete any code!

Adobe Page Mill
Choose View > Source Mode and paste the JavaScript code between
<NOEDIT> and </NOEDIT> comments.