gpt4 book ai didi

Cordova 和 Google Analytics 插件

转载 作者:行者123 更新时间:2023-12-02 06:49:57 46 4
gpt4 key购买 nike

我已经尝试了几个小时,让这个插件在 Cordova 5.1 应用程序上运行。

https://github.com/danwilson/google-analytics-plugin

按照简单的说明,我应该能够跟踪我的应用上的网页浏览量和事件,但我看不到我的 Google Analytics(分析)帐户中发生的任何事情。

我按照各地的建议创建了一个APP帐户。我去实时检查但没有成功。这是我的小代码:

onDeviceReady: function() {

navigator.splashscreen.hide();

if (typeof window.analytics !== 'undefined'){
console.log("We got Analytics");
window.analytics.startTrackerWithId('UA-67560028-3', function(){
console.log("Started OK");
window.analytics.trackView('Home');
});

}
else
{
console.log("Google Analytics plugin could not be loaded.")
}

}

当我构建应用程序并将其安装在我的设备上时,我可以从 Dalvik 控制台看到“Habemus Analyticsss”。当我运行“cordova插件列表”时,我可以看到插件已正确安装:

cordova-plugin-google-analytics 0.8.0 "Google Universal Analytics Plugin"

如有任何帮助,我们将不胜感激,非常感谢!

顺便说一句,这是我的 list 文件:

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="com.labrtve.trazosurbanos" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
</manifest>

最佳答案

您阅读过该插件的文档吗?

Important Note If the latest versions (0.8.0+) of this plugin are not working for you with Android on Cordova 5.0+, please try to use an earlier version while the fix is researched via:

cordova plugin add cordova-plugin-google-analytics@0.7.1

关于Cordova 和 Google Analytics 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32582286/

46 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com