This repository was archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathanalytics.inc
More file actions
39 lines (32 loc) · 1.32 KB
/
analytics.inc
File metadata and controls
39 lines (32 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
$has_analytics = true;
$analytics_account = "UA-305132-6";
function analytics_print($virtual_page=null, $account=null) {
/*
* first, the feedburner stuff
* login went to fink-core-private, 02/23/2007
*/
print "<script src=\"http://feeds2.feedburner.com/~s/FinkProjectNews\" type=\"text/javascript\" charset=\"utf-8\"></script>\n";
if ($account == null) {
global $analytics_account;
$account = $analytics_account;
}
// next, google analytics
print "<script type=\"text/javascript\">\n";
print " var gaJsHost = ((\"https:\" == document.location.protocol)? \"https://ssl.\":\"http://www.\");\n";
print " document.write(\"\\<script src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'>\\<\\/script>\");\n";
print "</script>\n";
print "<script type=\"text/javascript\">\n";
print " var pageTracker = _gat._getTracker(\"$account\");\n";
print " pageTracker._initData();\n";
if ($virtual_page != null) {
print " pageTracker._trackPageview(\"$virtual_page\");\n";
} else {
print " pageTracker._trackPageview();\n";
}
print "</script>\n";
}
function analytics_download_link($href, $contents, $analytics_name) {
print "<a href=\"$href\" onClick=\"pageTracker._trackPageview('" . str_replace(array("'", "\""), array("\\'", "\""), $analytics_name) . "');\">" . $contents . '</a>';
}
?>