mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-26 13:19:49 +07:00
* Remove docs folder. This was a redirect from a GitHub pages site that does not appear to be in use. * Rename api folder to api-samples. * Move examples to functional-samples folder. * Move cookbook sample to functional-samples. * Move tutorials to functional-samples folder. * Move mv2 and apps folders to _archive. * Rename tools folder to .repo. * Move reference folder to functional-samples. * Update README. Update README with new relative links for reorg. * Update README.md Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com> --------- Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
50 lines
1.6 KiB
JavaScript
50 lines
1.6 KiB
JavaScript
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
/**
|
|
* Add your Analytics tracking ID here.
|
|
*/
|
|
var _AnalyticsCode = 'UA-XXXXXX-X';
|
|
|
|
/**
|
|
* Below is a modified version of the Google Analytics asynchronous tracking
|
|
* code snippet. It has been modified to pull the HTTPS version of ga.js
|
|
* instead of the default HTTP version. It is recommended that you use this
|
|
* snippet instead of the standard tracking snippet provided when setting up
|
|
* a Google Analytics account.
|
|
*/
|
|
var _gaq = _gaq || [];
|
|
_gaq.push(['_setAccount', _AnalyticsCode]);
|
|
_gaq.push(['_trackPageview']);
|
|
|
|
(function() {
|
|
var ga = document.createElement('script');
|
|
ga.type = 'text/javascript';
|
|
ga.async = true;
|
|
ga.src = 'https://ssl.google-analytics.com/ga.js';
|
|
var s = document.getElementsByTagName('script')[0];
|
|
s.parentNode.insertBefore(ga, s);
|
|
})();
|
|
|
|
/**
|
|
* Track a click on a button using the asynchronous tracking API.
|
|
*
|
|
* See http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html
|
|
* for information on how to use the asynchronous tracking API.
|
|
*/
|
|
function trackButtonClick(e) {
|
|
_gaq.push(['_trackEvent', e.target.id, 'clicked']);
|
|
}
|
|
|
|
/**
|
|
* Now set up your event handlers for the popup's `button` elements once the
|
|
* popup's DOM has loaded.
|
|
*/
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
var buttons = document.querySelectorAll('button');
|
|
for (var i = 0; i < buttons.length; i++) {
|
|
buttons[i].addEventListener('click', trackButtonClick);
|
|
}
|
|
});
|