diff --git a/CHANGELOG.md b/CHANGELOG.md index de93781..be3734b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,14 @@ All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [1.1.0] ### Fixed -- Pointed the Firefox Add-On Store link in the readme to the right URL +- Pointed the Firefox Add-On Store link in the readme to the right URL. +- Fixed project.clj so that the extension can be compiled with no additional profiles enabled> + +### Removed +- Removed all analytics and usage tracking. ## [1.0.1] ### Added @@ -17,6 +23,7 @@ All notable changes to this project will be documented in this file. This change - Functionality to fetch and display Hacker News comments for the current URL. - Analytics through [Amplitude](https://amplitude.com). -[Unreleased]:https://github.com/jdormit/looped-in/compare/v1.0.1...HEAD -[1.0.0]: https://github.com/jdormit/looped-in/compare/9bf8d142c6a49b743da4b97574dfed0797dd5b2f...v1.0.0 +[Unreleased]:https://github.com/jdormit/looped-in/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/jdormit/looped-in/compare/v1.0.1...v1.0.0 [1.0.1]: https://github.com/jdormit/looped-in/compare/v1.0.0...v1.0.1 +[1.0.0]: https://github.com/jdormit/looped-in/compare/9bf8d142c6a49b743da4b97574dfed0797dd5b2f...v1.0.0 diff --git a/README.md b/README.md index 427aafc..f7bb2f9 100644 --- a/README.md +++ b/README.md @@ -21,30 +21,6 @@ This will output the generated JavaScript to `ext/js/generated`. To load the extension locally in your browser, see [instructions for Firefox](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox) or [instructions for Chrome](https://developer.chrome.com/extensions/getstarted#unpacked). -## Analytics -Looped In uses [Amplitude](https://amplitude.com) to track user actions such as clicking on a story or viewing replies to a comment. This data is useful for improving the program. However, some users find this tracking invasive, so Looped In respects the browser's [Do Not Track](https://www.w3.org/2011/tracking-protection/drafts/tracking-dnt.html) setting. If DNT is enabled, no analytics data is collected. To enable DNT, see [instructions for Firefox](https://support.mozilla.org/en-US/kb/how-do-i-turn-do-not-track-feature?redirectlocale=en-US&redirectslug=how-do-i-stop-websites-tracking-me) and [instructions for Chrome](https://support.google.com/chrome/answer/2790761). - -If you are running the extension locally, you will either need to get an Amplitude API key or disable the analytics. The easiest way to disable the analytics is to edit the `src/looped_in/analytics.cljs` file. Delete the bodies of the `init-amplitude` and `log-event` functions. It should look something like this: - -```clojure -(defn init-amplitude [] ()) -(defn log-event [] ()) -``` - -If you want to keep the analytics, you'll need an Amplitude API key. [Sign up for Amplitude](https://amplitude.com/signup?ref=nav) and follow the getting started guide to create a new project. Once you have the API key, create the file `profiles.clj` at the project root with the following content: - -```clojure -{:provided [:cljs-shared - {:cljsbuild - {:builds - {:main - {:compiler - {:closure-defines {looped-in.analytics/amplitude-api-key - ""}}}}}}] -``` - -Then run `lein cljsbuild once` to rebuild the extension with the new API key (you may need to first delete `ext/js/generated` to force a fresh build). - ## License Copyright © 2018 Jeremy Dormitzer diff --git a/src/looped_in/analytics.cljs b/src/looped_in/analytics.cljs deleted file mode 100644 index 900da00..0000000 --- a/src/looped_in/analytics.cljs +++ /dev/null @@ -1,61 +0,0 @@ -;; Copyright © 2018 Jeremy Dormitzer -;; -;; This file is part of Looped In. -;; -;; Looped In is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. -;; -;; Looped In is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with Looped In. If not, see . - -(ns looped-in.analytics - (:require [goog.dom :as dom] - [cljs.core.async :refer [go chan !]] - [looped-in.promises :refer [promise->channel]] - [looped-in.logging :as log])) - -(goog-define amplitude-api-key "FAKE_API_KEY") - -(def amplitude-init-code - (str "(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement('script');r.type='text/javascript';r.async=true;r.src='https://cdn.amplitude.com/libs/amplitude-4.1.0-min.gz.js';r.onload=function(){if(e.amplitude.runQueuedFunctions){e.amplitude.runQueuedFunctions()}else{console.log('[Amplitude] Error: could not load SDK')}};var i=t.getElementsByTagName('script')[0];i.parentNode.insertBefore(r,i);function s(e,t){e.prototype[t]=function(){this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));return this}}var o=function(){this._q=[];return this};var a=['add','append','clearAll','prepend','set','setOnce','unset'];for(var u=0;u js/browser - (.-runtime) - (.sendMessage (clj->js {:type "getUserId"})) - (promise->channel) - (js properties) - (fn [response-code response-body] - (go (>! res-channel {:code response-code - :body response-body})))))) - res-channel)) - ([event-name] (log-event event-name nil))) diff --git a/src/looped_in/background.cljs b/src/looped_in/background.cljs index 52ea1b8..bcf06e0 100644 --- a/src/looped_in/background.cljs +++ b/src/looped_in/background.cljs @@ -20,7 +20,6 @@ [ajax.core :refer [GET]] [goog.string :as gstring] [looped-in.hackernews :as hn] - [looped-in.analytics :as analytics] [looped-in.logging :as log] [looped-in.promises :refer [channel->promise promise->channel]])) @@ -103,8 +102,7 @@ "hits" (channel->promise (go @hits)) "fetchItem" (channel->promise (go (clj->js (promise (get-user-id)) - "logEvent" (analytics/log-event (.-eventType msg) (.-eventProperties msg)))) + "getUserId" (channel->promise (get-user-id)))) (-> js/browser (.-tabs) @@ -125,5 +123,3 @@ (.-runtime) (.-onMessage) (.addListener handle-message)) - -(analytics/init-amplitude) diff --git a/src/looped_in/content.cljs b/src/looped_in/content.cljs index fb80ce8..58c7fcd 100644 --- a/src/looped_in/content.cljs +++ b/src/looped_in/content.cljs @@ -19,7 +19,6 @@ (:require [goog.dom :as dom] [goog.events :as events] [goog.style :as style] - [looped-in.analytics :as analytics] [looped-in.logging :as log])) (def sidebar-width 300) @@ -52,8 +51,6 @@ (defn close-sidebar [] (let [$html (.-documentElement js/document) $sidebar (dom/getElement "loopedInSidebar")] - (-> js/browser (.-runtime) (.sendMessage (clj->js {:type "logEvent" - :eventType "CLOSED_SIDEBAR"}))) (dom/removeNode $sidebar) (set! (-> $html (.-style) (.-paddingLeft)) @old-html-padding))) diff --git a/src/looped_in/sidebar.cljs b/src/looped_in/sidebar.cljs index f640f63..965c969 100644 --- a/src/looped_in/sidebar.cljs +++ b/src/looped_in/sidebar.cljs @@ -22,8 +22,7 @@ [looped-in.hackernews :as hn] [looped-in.components :as components] [looped-in.promises :refer [promise->channel]] - [looped-in.logging :as log] - [looped-in.analytics :as analytics])) + [looped-in.logging :as log])) (enable-console-print!) @@ -118,13 +117,7 @@ "div" "storyHeader" (components/body30 (:title current-item)) - (components/with-listener - (components/item-link (:id current-item)) - "click" - (fn [e] - (analytics/log-event - "CLICKED_HN_EXTERNAL_LINK" - {:type "story"})))) + (components/item-link (:id current-item))) (components/story-caption (:points current-item) (:author current-item) (* (:created_at_i current-item) 1000))) @@ -135,13 +128,7 @@ (components/comment-caption (:author current-item) (* (:created_at_i current-item) 1000)) - (components/with-listener - (components/item-link (:id current-item)) - "click" - (fn [e] - (analytics/log-event - "CLICKED_HN_EXTERNAL_LINK" - {:type "comment"})))) + (components/item-link (:id current-item))) (components/comment-text (:text current-item)))) (map-indexed (fn [index child] (-> (components/card @@ -151,13 +138,7 @@ (components/comment-caption (:author child) (* (:created_at_i child) 1000)) - (components/with-listener - (components/item-link (:id child)) - "click" - (fn [e] - (analytics/log-event - "CLICKED_HN_EXTERNAL_LINK" - {:type "comment"})))) + (components/item-link (:id child))) (components/comment-text (:text child)) (-> (components/replies-indicator (count (:children child))) @@ -168,9 +149,6 @@ (components/with-listener "click" (fn [e] - (analytics/log-event - "CLICKED_HN_VIEW_COMMENTS" - {:depth (count (:depth state))}) (dispatch-message {:type :enq-depth :index index})))) @@ -195,13 +173,7 @@ "div" "storyHeader" (components/body30 (:title hit)) - (components/with-listener - (components/item-link (:objectID hit)) - "click" - (fn [e] - (analytics/log-event - "CLICKED_HN_EXTERNAL_LINK" - {:type "story"})))) + (components/item-link (:objectID hit))) (components/story-caption (:points hit) (:author hit) (* (:created_at_i hit) 1000)) @@ -213,7 +185,6 @@ (components/with-listener "click" (fn [e] - (analytics/log-event "CLICKED_HN_STORY") (dispatch-message {:type :loading :loading true}) (go (-> (fetch-item (:objectID hit)) @@ -251,7 +222,6 @@ (events/listen (dom/getElement "backButton") "click" (fn [e] - (analytics/log-event "CLICKED_BACK_BUTTON" {:depth (count (:depth state))}) (let [depth (:depth state)] (if (> (count depth) 0) (dispatch-message {:type :deq-depth}) @@ -283,8 +253,6 @@ [] (let [initial-state (update-state {:type :loading :loading true} (model))] (run-render-loop initial-state) - (analytics/init-amplitude) - (analytics/log-event "OPENED_SIDEBAR") (go (-> (fetch-hits) (