The usage tracking code is added dynamically to all SharePoint pages using a SharePoint solution. For more information, see Configuring Usage Tracking and Reporting for SharePoint Online, or for SharePoint On-Premise.
It can also be copied into every page you wish to track, and is best placed following the opening <HEAD> tag. Select the SharePoint farm version you would like configure and the code will be automatically generated.
Usage Tracking Code Main Window