
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
com.github.mbiamont:ga-annotations-plugin
Advanced tools
Gradle plugin to use Google Analytics Annotations Library
#Google Analytics Annotations
Android library to use Google Analytics through annotations.
In your build.gradle
file add these lines :
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.github.mbiamont:ga-annotations-plugin:1.1.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'GAAnnotations'
(...)
dependencies {
(...)
compile 'com.github.mbiamont:ga-annotations-library:1.2.1'
}
In the onCreate()
method of your Application
class, add this line :
AnalyticsManager.getInstance().init(context, "YOUR_GOOGLE_ANALYTICS_TRACKER_ID");
@TrackEvent(category = "ui_action", action = "on_click", label = "on_click_login_button", value = 1)
private void onLoginButtonClicked(){
(...)
}
@TrackScreen(name = "MainActivity")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
(...)
}
If you have to use multiple trackerId in your application, you can define for each event or screen the tracker to use.
Example :
@TrackScreen(trackerId= "UA-XXXX1", name = "MainActivity")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
(...)
}
If you just want to check if the tracks are correctly implemented; you can use the debugMode. It'll print tracks in LogCat instead of send them.
Just replace AnalyticsManager.getInstance().init()
by
AnalyticsManager.getInstance().debugMode(context, true);
Sometimes, you cannot use annotations (if your tracks require a condition for example). In this case, you can use trackers manually :
private void onLoginButtonClicked(){
if(user.isLogged()){
AnalyticsManager.getInstance().trackEvent(new Event.Builder()
.withCategory("ui_action")
.withAction("on_click")
.withLabel("on_click_login_button")
.build());
//or simply : AnalyticsManager.getInstance().trackEvent("ui_action", "on_click", "on_click_login_button", 1);
}
(...)
}
or
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if(user.isLogged()){
AnalyticsManager.getInstance().trackScreen("MainActivity");
}
(...)
}
Copyright 2015-2016 Melvin Biamont
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
FAQs
Gradle plugin to use Google Analytics Annotations Library
We found that com.github.mbiamont:ga-annotations-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.