Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Google Analytics

  • Loading branch information...
commit 610533e67c45277ac8e165804f9b5e426d644516 1 parent b5cdf42
@ChaitanyaPramod authored
Showing with 15 additions and 1 deletion.
  1. +12 −0 background.html
  2. +2 −0  background.js
  3. +1 −1  manifest.json
View
12 background.html
@@ -1,6 +1,18 @@
<!DOCTYPE html>
<html>
<head>
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-29329416-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
<script type="text/javascript" src="background.js">
</script>
</head>
View
2  background.js
@@ -57,10 +57,12 @@ function _toggleStarRules(tabId, /*Boolean*/ setStarRules) {
function contextMenuListener(info, tab) {
toggleStarRules(tab.id);
+ _gaq.push(["_trackEvent", "toggled", "contextMenu"]);
}
function browserActionListener(tab) {
toggleStarRules(tab.id);
+ _gaq.push(["_trackEvent", "toggled", "browserAction"]);
}
chrome.browserAction.onClicked.addListener(browserActionListener);
View
2  manifest.json
@@ -1,6 +1,6 @@
{
"name" : "Star-rules",
- "version" : "0.0.1",
+ "version" : "0.0.2",
"description" : "Apply CSS rules to all elements on the page",
"background_page" : "background.html",
"browser_action" : {
Please sign in to comment.
Something went wrong with that request. Please try again.