Google Analytics Helper for CodeIgniter

/ Published in: PHP
Save to your folder(s)

Below are two functions I've been using to make event tracking a little easier in CodeIgniter.

Two functions are available, google_analytics() & track_event().

google_analytics() takes one argument and uses it as the UA code for your tracking profile. track_event has two required parameters, $category and $event. The other two items are optional and won't be inserted unless specified.

Usage is pretty straight-forward:


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.