{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare-odk/pulls/comments/49955791","id":49955791,"diff_hunk":"@@ -43,27 +42,123 @@\n      * triggers.\n      */\n     public final static String FIRE_TRIGGERS_ON_SAVE = \"cc-fire-triggers-on-save\";\n-\n     public final static String ALTERNATE_QUESTION_LAYOUT_ENABLED = \"cc-alternate-question-text-format\";\n+    public final static String ANALYTICS_ENABLED = \"cc-analytics-enabled\";\n \n     @Override\n     protected void onCreate(Bundle savedInstanceState) {\n         super.onCreate(savedInstanceState);\n \n-        PreferenceManager prefMgr = getPreferenceManager();\n+        GoogleAnalyticsUtils.reportPrefActivityEntry(GoogleAnalyticsFields.CATEGORY_DEV_PREFS);\n \n+        PreferenceManager prefMgr = getPreferenceManager();\n         prefMgr.setSharedPreferencesName((CommCareApplication._().getCurrentApp().getPreferencesFilename()));\n \n         addPreferencesFromResource(R.xml.preferences_developer);\n         setTitle(\"Developer Preferences\");\n+\n+        createPreferenceOnClickListeners(prefMgr);\n+    }\n+\n+    private void createPreferenceOnClickListeners(PreferenceManager prefManager) {\n+        String[] prefKeys = {\n+                SUPERUSER_ENABLED,\n+                ACTION_BAR_ENABLED,\n+                GRID_MENUS_ENABLED,\n+                NAV_UI_ENABLED,\n+                LIST_REFRESH_ENABLED,\n+                NEWEST_APP_VERSION_ENABLED,\n+                ENABLE_AUTO_LOGIN,\n+                ENABLE_SAVE_SESSION,\n+                CSS_ENABLED,\n+                MARKDOWN_ENABLED,\n+                ALTERNATE_QUESTION_LAYOUT_ENABLED,\n+                FIRE_TRIGGERS_ON_SAVE,\n+                HOME_REPORT_ENABLED};\n+        String[] analyticsLabels = {\n+                GoogleAnalyticsFields.LABEL_DEV_MODE,\n+                GoogleAnalyticsFields.LABEL_ACTION_BAR,\n+                GoogleAnalyticsFields.LABEL_GRID_MENUS,\n+                GoogleAnalyticsFields.LABEL_NAV_UI,\n+                GoogleAnalyticsFields.LABEL_ENTITY_LIST_REFRESH,\n+                GoogleAnalyticsFields.LABEL_NEWEST_APP_VERSION,\n+                GoogleAnalyticsFields.LABEL_AUTO_LOGIN,\n+                GoogleAnalyticsFields.LABEL_SESSION_SAVING,\n+                GoogleAnalyticsFields.LABEL_CSS,\n+                GoogleAnalyticsFields.LABEL_MARKDOWN,\n+                GoogleAnalyticsFields.LABEL_IMAGE_ABOVE_TEXT,\n+                GoogleAnalyticsFields.LABEL_TRIGGERS_ON_SAVE,\n+                GoogleAnalyticsFields.LABEL_REPORT_BUTTON_ENABLED};\n+\n+        for (int i = 0; i < prefKeys.length; i++) {\n+            GoogleAnalyticsUtils.createPreferenceOnClickListener(prefManager, prefKeys[i],\n+                    GoogleAnalyticsFields.CATEGORY_DEV_PREFS, analyticsLabels[i]);\n+        }\n     }\n \n     @Override\n     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\n-        if (key.equals(ENABLE_AUTO_LOGIN) && !isAutoLoginEnabled()) {\n-            DevSessionRestorer.clearPassword(sharedPreferences);\n-        } else if (key.equals(ENABLE_SAVE_SESSION) && !isSessionSavingEnabled()) {\n-            DevSessionRestorer.clearSession();\n+        String editPrefLabel = \"\";\n+        switch(key) {\n+            case SUPERUSER_ENABLED:\n+                editPrefLabel = GoogleAnalyticsFields.LABEL_DEV_MODE;","path":"app/src/org/commcare/dalvik/preferences/DeveloperPreferences.java","position":null,"original_position":94,"commit_id":"77bb97897e523001ed803bda984b46771090e1a3","original_commit_id":"81c18a2306a29d2fc53b791995d833dd8a22632d","user":{"login":"amstone326","id":3723143,"avatar_url":"https://avatars.githubusercontent.com/u/3723143?v=3","gravatar_id":"","url":"https://api.github.com/users/amstone326","html_url":"https://github.com/amstone326","followers_url":"https://api.github.com/users/amstone326/followers","following_url":"https://api.github.com/users/amstone326/following{/other_user}","gists_url":"https://api.github.com/users/amstone326/gists{/gist_id}","starred_url":"https://api.github.com/users/amstone326/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amstone326/subscriptions","organizations_url":"https://api.github.com/users/amstone326/orgs","repos_url":"https://api.github.com/users/amstone326/repos","events_url":"https://api.github.com/users/amstone326/events{/privacy}","received_events_url":"https://api.github.com/users/amstone326/received_events","type":"User","site_admin":false},"body":"Fixed","created_at":"2016-01-18T00:44:43Z","updated_at":"2016-01-18T00:44:43Z","html_url":"https://github.com/dimagi/commcare-odk/pull/816#discussion_r49955791","pull_request_url":"https://api.github.com/repos/dimagi/commcare-odk/pulls/816","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-odk/pulls/comments/49955791"},"html":{"href":"https://github.com/dimagi/commcare-odk/pull/816#discussion_r49955791"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare-odk/pulls/816"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-odk/pulls/816","id":50672056,"html_url":"https://github.com/dimagi/commcare-odk/pull/816","diff_url":"https://github.com/dimagi/commcare-odk/pull/816.diff","patch_url":"https://github.com/dimagi/commcare-odk/pull/816.patch","issue_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/816","number":816,"state":"open","locked":false,"title":"Product-Level analytics","user":{"login":"amstone326","id":3723143,"avatar_url":"https://avatars.githubusercontent.com/u/3723143?v=3","gravatar_id":"","url":"https://api.github.com/users/amstone326","html_url":"https://github.com/amstone326","followers_url":"https://api.github.com/users/amstone326/followers","following_url":"https://api.github.com/users/amstone326/following{/other_user}","gists_url":"https://api.github.com/users/amstone326/gists{/gist_id}","starred_url":"https://api.github.com/users/amstone326/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amstone326/subscriptions","organizations_url":"https://api.github.com/users/amstone326/orgs","repos_url":"https://api.github.com/users/amstone326/repos","events_url":"https://api.github.com/users/amstone326/events{/privacy}","received_events_url":"https://api.github.com/users/amstone326/received_events","type":"User","site_admin":false},"body":"Includes reporting for all events that Amelia/Kevin/I identified as wanting in the first pass for product-level analytics. The GoogleAnalyticsUtils and GoogleAnalyticsFields classes provide good context and explanations for what was added, and I outlined/explained the hierarchy of event reporting in more detail here: https://docs.google.com/a/dimagi.com/spreadsheets/d/1-vdt6oiaHwNcbN7Dz6qc6o69RA3J5C-eLP85hf0z2po/edit?usp=sharing\r\n\r\n**Ready for review but don't merge yet; missing some small final add-ons like legal stuff**\r\n\r\n@dimagi/product ","created_at":"2015-11-13T18:05:19Z","updated_at":"2016-01-18T00:44:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e4d7a8a4e93f52010437e7f52cd97eb3e5890e5","assignee":null,"milestone":{"url":"https://api.github.com/repos/dimagi/commcare-odk/milestones/6","html_url":"https://github.com/dimagi/commcare-odk/milestones/commcare_2.26","labels_url":"https://api.github.com/repos/dimagi/commcare-odk/milestones/6/labels","id":1429885,"number":6,"title":"commcare_2.26","description":null,"creator":{"login":"phillipm","id":94817,"avatar_url":"https://avatars.githubusercontent.com/u/94817?v=3","gravatar_id":"","url":"https://api.github.com/users/phillipm","html_url":"https://github.com/phillipm","followers_url":"https://api.github.com/users/phillipm/followers","following_url":"https://api.github.com/users/phillipm/following{/other_user}","gists_url":"https://api.github.com/users/phillipm/gists{/gist_id}","starred_url":"https://api.github.com/users/phillipm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillipm/subscriptions","organizations_url":"https://api.github.com/users/phillipm/orgs","repos_url":"https://api.github.com/users/phillipm/repos","events_url":"https://api.github.com/users/phillipm/events{/privacy}","received_events_url":"https://api.github.com/users/phillipm/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":82,"state":"open","created_at":"2015-11-25T18:23:45Z","updated_at":"2016-01-15T21:49:04Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/dimagi/commcare-odk/pulls/816/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare-odk/pulls/816/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare-odk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/816/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare-odk/statuses/77bb97897e523001ed803bda984b46771090e1a3","head":{"label":"dimagi:analytics","ref":"analytics","sha":"77bb97897e523001ed803bda984b46771090e1a3","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":20939877,"name":"commcare-odk","full_name":"dimagi/commcare-odk","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-odk","description":"The best open source form management tool in town","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-odk","forks_url":"https://api.github.com/repos/dimagi/commcare-odk/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-odk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-odk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-odk/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-odk/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-odk/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-odk/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-odk/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-odk/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-odk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-odk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-odk/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-odk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-odk/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-odk/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-odk/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-odk/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-odk/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-odk/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-odk/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-odk/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-odk/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-odk/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-odk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-odk/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-odk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-odk/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-odk/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-odk/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-odk/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-odk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-odk/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-odk/releases{/id}","created_at":"2014-06-17T21:17:26Z","updated_at":"2016-01-12T15:10:23Z","pushed_at":"2016-01-18T00:43:18Z","git_url":"git://github.com/dimagi/commcare-odk.git","ssh_url":"git@github.com:dimagi/commcare-odk.git","clone_url":"https://github.com/dimagi/commcare-odk.git","svn_url":"https://github.com/dimagi/commcare-odk","homepage":"https://play.google.com/store/apps/details?id=org.commcare.dalvik&hl=en","size":64231,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":17,"forks":9,"open_issues":17,"watchers":5,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"f45026b58f5871e87e0b63a8eaee4b6bb5549e5f","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":20939877,"name":"commcare-odk","full_name":"dimagi/commcare-odk","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-odk","description":"The best open source form management tool in town","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-odk","forks_url":"https://api.github.com/repos/dimagi/commcare-odk/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-odk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-odk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-odk/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-odk/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-odk/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-odk/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-odk/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-odk/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-odk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-odk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-odk/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-odk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-odk/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-odk/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-odk/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-odk/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-odk/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-odk/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-odk/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-odk/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-odk/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-odk/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-odk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-odk/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-odk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-odk/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-odk/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-odk/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-odk/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-odk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-odk/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-odk/releases{/id}","created_at":"2014-06-17T21:17:26Z","updated_at":"2016-01-12T15:10:23Z","pushed_at":"2016-01-18T00:43:18Z","git_url":"git://github.com/dimagi/commcare-odk.git","ssh_url":"git@github.com:dimagi/commcare-odk.git","clone_url":"https://github.com/dimagi/commcare-odk.git","svn_url":"https://github.com/dimagi/commcare-odk","homepage":"https://play.google.com/store/apps/details?id=org.commcare.dalvik&hl=en","size":64231,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":17,"forks":9,"open_issues":17,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-odk/pulls/816"},"html":{"href":"https://github.com/dimagi/commcare-odk/pull/816"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare-odk/issues/816"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare-odk/issues/816/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare-odk/pulls/816/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare-odk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare-odk/pulls/816/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare-odk/statuses/77bb97897e523001ed803bda984b46771090e1a3"}}}}