1

我想跟蹤使用科爾多瓦開發的應用程序的安裝源。針對科爾多瓦的谷歌廣告系列

即時通訊使用這個插件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.xmlapplication標籤內容:

<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')的東西???

謝謝。

回答

0

我終於找到了,

整個插件工作正常,反而使我需要安裝在建築機械上的「谷歌Play服務SDK」谷歌的競選工作。其餘的是在引擎蓋下完成的。