本文整理汇总了Java中com.brsanthu.googleanalytics.GoogleAnalytics类的典型用法代码示例。如果您正苦于以下问题:Java GoogleAnalytics类的具体用法?Java GoogleAnalytics怎么用?Java GoogleAnalytics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GoogleAnalytics类属于com.brsanthu.googleanalytics包,在下文中一共展示了GoogleAnalytics类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildGoogleAnalyticsClient
import com.brsanthu.googleanalytics.GoogleAnalytics; //导入依赖的package包/类
/**
* Method that builds a {@link GoogleAnalytics} object with the tracking id read from a plugins.properties file.
*
* @return a new instance of GoogleAnalytics.
*/
private static GoogleAnalytics buildGoogleAnalyticsClient() {
Properties pluginProps = new Properties();
InputStream inputStream = null;
try {
inputStream = Analytics.class.getResourceAsStream(PLUGIN_PROPERTIES_FILE);
if (inputStream == null) {
LOGGER.warning("Unable to load plugin properties " + PLUGIN_PROPERTIES_FILE);
return null;
}
pluginProps.load(inputStream);
String trackingId = pluginProps.getProperty(GOOGLE_PROPERTIES_KEY);
LOGGER.fine("Using Google Analytics Tracking ID :: " + trackingId);
if (StringUtils.isNotEmpty(trackingId)) {
return new GoogleAnalytics(trackingId);
}
} catch (IOException ioe) {
LOGGER.warning("Unable to log analytics to GA cause of exception. " + ioe.getMessage());
isEnabled = false;
} finally {
IOUtils.closeQuietly(inputStream);
}
return null;
}
开发者ID:jenkinsci,项目名称:browserstack-integration-plugin,代码行数:30,代码来源:Analytics.java
示例2: AnalyticsTrackerImpl
import com.brsanthu.googleanalytics.GoogleAnalytics; //导入依赖的package包/类
public AnalyticsTrackerImpl(@NotNull final PluginDescriptor pluginDescriptor, SBuildServer buildServer, @NotNull MetricRegistry metricRegistry, BuildTriggerProperties buildTriggerProperties) {
this.metricRegistry = metricRegistry;
this.buildTriggerProperties = buildTriggerProperties;
this.pluginVersion = pluginDescriptor.getPluginVersion();
this.teamCityVersion = buildServer.getFullServerVersion();
String trackingId = pluginDescriptor.getParameterValue("AnalyticsTrackingId");
boolean enabled = this.buildTriggerProperties.isAnalyticsEnabled();
LOG.info(String.format("AnalyticsTrackerImpl instantiated for plugin version %s in teamcity version %s. Tracking enabled: %s.",
pluginVersion, teamCityVersion, enabled));
try {
GoogleAnalyticsConfig config = new GoogleAnalyticsConfig()
.setEnabled(enabled);
ga = new GoogleAnalytics(config, trackingId);
}
catch (Throwable e) {
LOG.warn("Analytics initialisation failed. Disabling analytics", e);
}
}
开发者ID:matt-richardson,项目名称:teamcity-octopus-build-trigger-plugin,代码行数:20,代码来源:AnalyticsTrackerImpl.java
示例3: getInstance
import com.brsanthu.googleanalytics.GoogleAnalytics; //导入依赖的package包/类
public static GoogleAnalytics getInstance() {
if (instance == null) {
Properties.wake();
GoogleAnalyticsConfig config = new GoogleAnalyticsConfig();
config.setEnabled(true);
config.setRequestParameterDiscoverer(new AwtRequestParameterDiscoverer());
config.setValidate(true);
DefaultRequest defaultRequest = new DefaultRequest();
defaultRequest.trackingId(Constants.GOOGLE_ANALYTICS_ID);
defaultRequest.clientId(Properties.uuid);
defaultRequest.applicationName(Constants.GOOGLE_ANALYTICS_APP_NAME);
defaultRequest.applicationVersion(Constants.VERSION_STRING);
instance = new GoogleAnalyticsBuilder()
.withDefaultRequest(defaultRequest)
.withConfig(config)
.build();
}
return instance;
}
开发者ID:Warlander,项目名称:DeedPlanner-2,代码行数:24,代码来源:Analytics.java
示例4: AnalyticsReporting
import com.brsanthu.googleanalytics.GoogleAnalytics; //导入依赖的package包/类
private AnalyticsReporting(IPermission permission) {
this.ga = new GoogleAnalytics("UA-57580474-6");
this.appname = GlobalConf.APPLICATION_NAME;
this.languagetag = I18n.locale.toLanguageTag().toLowerCase();
this.version = GlobalConf.version.version + "." + GlobalConf.version.build;
this.permission = permission;
}
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:8,代码来源:AnalyticsReporting.java
示例5: configure
import com.brsanthu.googleanalytics.GoogleAnalytics; //导入依赖的package包/类
@Override
protected final void configure() {
bind(MoveFeedbackInterface.class).to(ImageSortMoveFeedbackProgressFeedback.class);
bind(CommandLineParser.class).to(GnuParser.class);
bind(Calendar.class).to(GregorianCalendar.class);
bind(GoogleAnalytics.class).toInstance(new GoogleAnalytics(new Passwords().getAnalyticsToken()));
bind(MessageBuilder.class).toInstance(new MessageBuilder(new Passwords().getMixpanelToken()));
}
开发者ID:kotlinski,项目名称:image-sort-master,代码行数:9,代码来源:ImageModule.java
示例6: TabGroupController
import com.brsanthu.googleanalytics.GoogleAnalytics; //导入依赖的package包/类
public TabGroupController() {
Injector injector = Guice.createInjector(new ImageModule());
googleAnalytics = injector.getInstance(GoogleAnalytics.class);
messageBuilder = injector.getInstance(MessageBuilder.class);
mixpanel = new MixpanelAPI();
sessionUniqueID = UUID.randomUUID().toString();
}
开发者ID:kotlinski,项目名称:image-sort-master,代码行数:8,代码来源:TabGroupController.java
示例7: GAWrapper
import com.brsanthu.googleanalytics.GoogleAnalytics; //导入依赖的package包/类
public GAWrapper(String trackingId) {
ga = new GoogleAnalytics(trackingId);
}
开发者ID:Nike-Inc,项目名称:cerberus-serverless-components,代码行数:4,代码来源:GoogleAnalyticsKPIProcessor.java
注:本文中的com.brsanthu.googleanalytics.GoogleAnalytics类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论