How to Track SharePoint Online websites with Angelfish
Angelfish creates reports by processing web server log files. But if you're a SharePoint Online customer, you aren't able to access the underlying IIS logs.
The solution is simple:
- add the AGF tracking code snippet to your SharePoint site
- configure angelfish.js to send the tracking request to another domain
- process those logs with Angelfish
The angelfish.js file can be configured to send the tracking gif to another domain via the “Hostname for Tracking Requests” parameter:
When a visitor accesses your SharePoint Online site, the tracking request will be sent to the web server you specify as the “Hostname for Tracking Requests”. Simply process the web logs from this server with Angelfish, and voila: web analytics reports for SharePoint Online.
New to Angelfish?
Angelfish is secure, on-premise web analytics software. Learn more here:
Here's how to setup Angelfish to track SharePoint Online:
1) Setup a web server (a.k.a. "AGF Server")
You can either spin up a new web server, or use an existing web server. We also recommend installing a TLS certificate on this server so you can use https in the AGF code reference.
This web server will serve up the AGF tracking code and collect the AGF tracking requests. A subdomain of an existing domain is fine, e.g. agf.yourdomain.com
The default log format is fine, regardless of the web server used.
2) Put angelfish.js and agf.gif in the root directory of the AGF Server
AGF code is used by the Angelfish tracking method, explained here:
AGF code installation instructions are here:
Be sure to use the Custom Tracking Code Generator so you can set the “Hostname for Tracking Requests” variable to the hostname or IP address of your AGF server:
3) Add AGF code to your SharePoint site
You will want to use an AGF code reference similar to the below code:
Be sure to replace <AGF-Server-name-or-IP-address> with your server information. The code also grabs the value of SharePoint's _spPageContextInfo.userLoginName variable and passes it to the username dimension in Angelfish.
The easiest way to add the angelfish.js reference is to edit your master page. Here's how to do this:
- Log into your SharePoint Online account.
- Select Site Actions - Site Settings.
- Select "Master pages and page layouts" under Galleries, or Master pages in the P1 plan.
- Select the checkbox for the master page file you are using and click "Download a Copy" on the ribbon. If you're not sure which master page file the site uses, check Site Settings - Look and Feel - Master Page.
- Open the downloaded master page file and paste the Angelfish tracking code reference above the closing head tag.
- Save the file.
- Click "‘Upload Document" from the master page gallery ribbon and select the file you just edited.
- Depending on the settings and you plan, you might need to publish and approve the new master page file before it can be applied to users. <\ul>
4) Install Angelfish and Create a Profile
It's not necessary to install the Angelfish application directly on the AGF Server. Angelfish can be installed anywhere as long as it's able to access the log files from the AGF Server.
If you haven't already watched the “Create a Profile” video, it can be viewed here:
We have a short list of recommendations for new SharePoint profiles - they can be seen here:
5) Process Data and View the Reports
Click the Process Data button in the Run/Data Management tab to start processing data. Once processing is complete, click the Profile Name in the All Profiles screen, or the “View Report” button in the Profile Config.
If you don't see any data in the reports, please verify the Datasource is configured correctly (i.e. the Location field matches log files, not just a directory), then delete data and reprocess.
If you need help, please open a support ticket so our technical team can assist.