Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
---
parent: analytics
title: how_it_works
---
# How It Works <%= edit_link %>
<%= partial 'partials/toc' %>
## The Tracking Script
> The source of the tracking script is hosted on
[GitHub](https://www.github.com/skroutz/analytics.js).
The tracking script, registers a new global function named `<%= "#{flavor}_analytics" %>`, and then
asynchronously loads the `analytics.js` library onto the page.
The `<%= "#{flavor}_analytics" %>` global function is the main way you interact with the Analytics library.
It accepts a sequence of parameters, that represent:
Category
: The API category
Command
: The Command of the API category you want to be executed
Data
: The Data to be reported by the Command
> ##### Note
> *Categories* and *Commands* are **case-sensitive**.
## Related Resources
* Configuration
* <%= link_to 'Analytics Settings', '/analytics/settings' %>
* <%= link_to 'Ecommerce metrics', '/analytics/ecommerce' %>
* <%= link_to 'Examples', '/analytics/examples' %>
* <%= link_to 'Libraries', '/analytics/libraries' %>