我想跟踪使用科尔多瓦开发的应用程序的安装源。针对科尔多瓦的谷歌广告系列
即时通讯使用这个插件https://github.com/danwilson/google-analytics-plugin/
在deviceReady
回调有这样一段代码:
window.ga.startTrackerWithId('UA-xxxxxxxx-y', 30)
.then(function(){
console.log('Google analytics is ready now');
//the component is ready and you can call any method here
GoogleAnalytics.debugMode();
GoogleAnalytics.setAllowIDFACollection(true);
})
.catch(e => console.log('Error starting GoogleAnalytics', e));
也在这里是在AndroidManifest.xml
的application
标签内容:
<receiver android:name="cordova.plugins.Diagnostic$LocationProviderChangedReceiver">
<intent-filter>
<action android:name="android.location.PROVIDERS_CHANGED" />
</intent-filter>
</receiver>
<receiver android:enabled="true" android:exported="true" android:name="com.google.android.gms.analytics.CampaignTrackingReceiver">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="com.google.android.gms.analytics.CampaignTrackingService" />
<receiver android:enabled="true" android:name="com.google.android.gms.analytics.AnalyticsReceiver">
<intent-filter>
<action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="com.google.android.gms.analytics.AnalyticsService" />
按照谷歌指南和测试使用这个link我得到了Broadcast completed: result=0
,所以一切都应该没问题。
同样在SO post中,他表示“作者为广告系列添加了未公开的功能,并且其工作原理没有任何修改,它在清单中添加了标签,并且在向Google Play启动活动链接时有效。意味着一切都自动完成,但它不是!
我是否在这个过程中遗漏了一些东西,或者有没有办法在deviceReady
回调中获取网址,而只是使用类似window.ga.trackView('Screen Title', 'my-scheme://content/1111?utm_source=google&utm_campaign=my-campaign')
的东西???
谢谢。