Skip to content

Google Analytics as per the Collection Protocol. Specifically useful for MXit.

License

Notifications You must be signed in to change notification settings

woffleloffle/ga-collection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google Analytics

Google Analytics as per the Collection Protocol.

Specifically useful for MXit & Mobile sites.


There are 2 different ways you can use this library.

PHP

  • Non-blocking using exec & cURL. (src)
  • Blocking using file_get_contents, but cURL-less.

Features

  • Easy config
  • Autohit
  • Include and forget

Notes

Non-blocking

Make sure your server has php_curl installed.

Blocking

Make sure your server has the allow_url_fopen flag set to On.

Usage

PHP Open and edit googleanalytics.php.

require_once("googleanalytics.php");

C#

Events

GoogleAnalytics ga = new GoogleAnalytics();
ga.GoogleAnalyticsTracking(Request.Url.GetLeftPart(UriPartial.Authority), HttpUtility.UrlEncode(Request.Url.PathAndQuery), Page.Title, "event", "click", "action", "label");

PageViews

GoogleAnalytics ga = new GoogleAnalytics();
ga.GoogleAnalyticsTracking(Request.Url.GetLeftPart(UriPartial.Authority), HttpUtility.UrlEncode(Request.Url.PathAndQuery),Page.Title, "pageview", "", "", "");

Easy as pie.

Pull requests welcomed.

:{D

About

Google Analytics as per the Collection Protocol. Specifically useful for MXit.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published