{"id":20962592,"url":"https://github.com/federicoiosue/analitica","last_synced_at":"2025-05-14T08:33:49.445Z","repository":{"id":150088587,"uuid":"81757506","full_name":"federicoiosue/analitica","owner":"federicoiosue","description":"Android library to manage both Google Analytics and Piwik services to match FOSS software need","archived":false,"fork":false,"pushed_at":"2020-02-24T18:27:23.000Z","size":141,"stargazers_count":6,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-10-20T19:48:53.293Z","etag":null,"topics":["analytics","analytics-tracking","android","android-library","google-analytics","library","piwik"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/federicoiosue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-02-12T21:12:09.000Z","updated_at":"2023-10-20T19:48:53.885Z","dependencies_parsed_at":"2023-06-05T06:00:38.706Z","dependency_job_id":null,"html_url":"https://github.com/federicoiosue/analitica","commit_stats":null,"previous_names":[],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicoiosue%2Fanalitica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicoiosue%2Fanalitica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicoiosue%2Fanalitica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicoiosue%2Fanalitica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/federicoiosue","download_url":"https://codeload.github.com/federicoiosue/analitica/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225282896,"owners_count":17449599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","analytics-tracking","android","android-library","google-analytics","library","piwik"],"created_at":"2024-11-19T02:35:35.906Z","updated_at":"2024-11-19T02:35:36.471Z","avatar_url":"https://github.com/federicoiosue.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":" ![icon](icon.png) \n\n# Analitica Library\n\n![Release](https://jitpack.io/v/federicoiosue/analitica.svg)\n\n## Overview\n\nUsefull library to manage both Google Analytics and Piwik services to match FOSS software need\n\n## Detailed overview\n\nWhen developing an application, expecially if you're a single developer or small development team, is extremelly important to have informations about how to improve your work for users. Having analytics informations helps you to decide what language to translate your app into, if supporting RTL languages is relevant and many more things.\n\nHowever, if you decide to work on a completelly open-sourced stack you can't simply include an arbitrary closed-source analytics library and go on. \nTo simplify this task *Analitica* offers to developers an helper to manage both [Google Analytics](https://www.google.it/intl/it/analytics/) and [Piwik](https://piwik.org/) third-party libraries gaving you the opportunity to include just one of them or both managing dependencies in a Gradle-flavored way.\n\n## How to include into your project\n\n**Step 1.** Add the following snippet in your root *build.gradle* at the end of repositories:\n\n```groovy\nallprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url 'https://jitpack.io' }\n\t}\n}\n```\n\n**Step 2.** Add the needed dependencies\n\n```groovy\ndependencies {\n\t{nonFossFlavor}Compile ('com.github.federicoiosue:analitica:{version}:googleAnalyticsRelease@aar'){\n        transitive=true\n    }\n\t{fossFlavor}Compile ('com.github.federicoiosue:analitica:{version}:piwikRelease@aar'){\n        transitive=true\n    }\n    {nonFossFlavor}Compile 'com.google.android.gms:play-services-analytics:10.0.1'\n    {fossFlavor}Compile 'org.piwik.sdk:piwik-sdk:1.0.2'\n}\n```\n\n## Usage\n\n### Instantiate helper\n\n#### Piwik\n\n```java\n\ntry {\n\tAnalyticsHelperanalyticsHelper = new AnalyticsHelperFactory().getAnalyticsHelper(context, true, PIWIK_URL, APPLICATION_ID);\n  ...\n} catch (AnalyticsInstantiationException | InvalidIdentifierException e) {\n\t...\n}\n```\n\n#### Google Analytics\n\n```java\n\ntry {\n\tAnalyticsHelperanalyticsHelper = new AnalyticsHelperFactory().getAnalyticsHelper(context, true, TRACKING_ID);\n  ...\n} catch (AnalyticsInstantiationException | InvalidIdentifierException e) {\n\t...\n}\n```\n\n### Events tracking\n\n```java\n// Track view\nanalyticsHelper.trackScreenView(\"VIEW NAME\");\n// Track action\nanalyticsHelper.trackEvent(CATEGORY, \"ACTION NAME\");\n```\n\n### Mocked Helper\n\nWhen analytics helper instantiation fail for any reason, or for development purposes when you don't want that any analytic data is sent a mock class is available.\n\n```java\n} catch (AnalyticsInstantiationException | InvalidIdentifierException e) {\n\tanalyticsHelper = new MockAnalyticsHelper();\n}\n```\n\nThis class' methods simply do nothing but providing an implementation of the same interface than working *AnalyticsHelper classes.\n\n## Apps using Analitica\n\n- [Omni Notes](https://github.com/federicoiosue/Omni-Notes)\n\n## Developed with love and passion by\n\n- Federico Iosue - [Website](http://www.iosue.it/federico)\n\n## License\n\n```\nCopyright 2017 Federico Iosue\n```\n\n```\nLicensed to the Apache Software Foundation (ASF) under one or more\n contributor license agreements.  See the NOTICE file distributed with\n this work for additional information regarding copyright ownership.\n The ASF licenses this file to You under the Apache License, Version 2.0\n (the \"License\"); you may not use this file except in compliance with\n the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericoiosue%2Fanalitica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedericoiosue%2Fanalitica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericoiosue%2Fanalitica/lists"}