• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GoogleAnalytics类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GenericRefreshProtocol类代码示例发布时间:2022-05-23
下一篇:
Java XMLStringDefault类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap