1) First, you need to login on your AFS Analytics account and select a website into the menu "website(s)"
2) Select the option “Tracking code” in the sub-menu "THIS WEBSITE" in the "Your Account" menu.
3) The page with the AFS Analytics tracking code is displayed.Example of AFS tracking code:
If your website is developed with WordPress, AFS analytics provides a web analytics plugin for implementing the code in your website pages.
If your website is developed in PHP or ASP, you can easily paste and save the code into a file and include it in your website.
If you use a content management system (
WordPress Analytics plugin,
, we've provided some useful installation guides for implementing AFS Analytics on several common web publishing platforms.
1) Select the code with the mouse inside the box.
2) Press Ctrl-C to copy the selected code. Make sure you copy the entire piece of code.
3) Open the HTML page you want to track in a text editor.
4) Press Ctrl-V to paste the copied code into your website HTML pages between the <head> and </head>(highly recommended) or <body> and </body> tags.
5) By default, AFS will use the first 100 characters of the text inserted between the <TITLE> and </TITLE> tags to detect the title of your page, so if you have no <TITLE> tags or your pages or titles are not correctly defined, you will have to set the page title with the command Send or Set commands via the function aa() of analytics.js library. Please read these guides for more information: Getting and Setting tracker data, Sending data to AFS Analytics, Page Tracking.
6) Save your web site page.
7) Upload your page to your website server.
Repeat these steps on every page you want to track or insert the tracking code via an include file on your website pages .
The new version no longer displays the AFS Logo on your website pages. However, if you want to display it, you have to specify its location by adding the following HTML code:
<div id = "afsanalytics"></div>
Note: For the free version, this tag is useful if your traffic exceeds the limit.
You can easily customize the code. To do this you need to review the guides available in the developer section.
If you want to modify the page title, just set the title parameter via the send command .
//The send parameters with pageview hitType aa("send","pageview",[page],[title],[location] ,[hitCallback],[params])
//Set the page title with "title of my page" aa("send", "pageview","titleindex","title of my page");
If your site is coded in PHP or ASP, you can define your own PHP/ASP variable.
//For example in PHP. $PageName="title of my page"; print "<script>n"; ... print "aa("send", "pageview","titleindex","$PageName");"; ... print "<script>n">;
For changing the URL of the page, you have to set the parameter Location.
//Set the page title with "title of my page" aa("send", "pageview","titleindex","title of my page","https://www.myurl.com/mypage.html");
We recommend you review these guides:
The other guides will be available ASAP.