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 , we provide a plugin installing AFS on your website pages. If you use WooCommerce, the enhanced Ecommerce will be enabled.
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 other content management system (
, 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 .
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: