N navicula Member Licensed User Longtime User Jun 2, 2014 #1 When I use this lines for Google Analytics, I get this error: Error occurred An error has occurred in sub: java.lang.NoSuchMethodException: getTracker() Code: Copy Dim r As Reflector r.Target = r.RunStaticMethod("com.google.analytics.tracking.android.EasyTracker", "getTracker", Null, Null) r.RunMethod2("sendView", "<pnlChartContains>", "java.lang.String") Why is it?
When I use this lines for Google Analytics, I get this error: Error occurred An error has occurred in sub: java.lang.NoSuchMethodException: getTracker() Code: Copy Dim r As Reflector r.Target = r.RunStaticMethod("com.google.analytics.tracking.android.EasyTracker", "getTracker", Null, Null) r.RunMethod2("sendView", "<pnlChartContains>", "java.lang.String") Why is it?
Erel B4X founder Staff member Licensed User Longtime User Jun 3, 2014 #2 Google Analytics SDK has changed. Your code calls an API that no longer exists. Upvote 0
N navicula Member Licensed User Longtime User Jun 3, 2014 #3 Erel said: Google Analytics SDK has changed. Your code calls an API that no longer exists. Click to expand... How can I get sendview in new SDK? Thank you for your answer. Upvote 0
Erel said: Google Analytics SDK has changed. Your code calls an API that no longer exists. Click to expand... How can I get sendview in new SDK? Thank you for your answer.
Erel B4X founder Staff member Licensed User Longtime User Jun 4, 2014 #4 What does sendview do? Upvote 0
N navicula Member Licensed User Longtime User Jun 4, 2014 #5 Erel said: What does sendview do? Click to expand... I would like to „Manual Screen Measurement”(https://developers.google.com/analytics/devguides/collection/android/v3/screens). How is it in b4a? The google write this: „To get the most complete screen view data, add the EasyTracker methods to all of the Activities in your app.” Code: Copy public class myTrackedActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public void onStart() { super.onStart(); ... // The rest of your onStart() code. EasyTracker.getInstance(this).activityStart(this); // Add this method. } @Override public void onStop() { super.onStop(); ... // The rest of your onStop() code. EasyTracker.getInstance(this).activityStop(this); // Add this method. } } And this: Code: Copy // May return null if EasyTracker has not yet been initialized with a property // ID. Tracker easyTracker = EasyTracker.getInstance(this); // This screen name value will remain set on the tracker and sent with // hits until it is set to a new value or to null. easyTracker.set(Fields.SCREEN_NAME, "Home Screen"); easyTracker.send(MapBuilder .createAppView() .build() ); Thank you for your help! Upvote 0
Erel said: What does sendview do? Click to expand... I would like to „Manual Screen Measurement”(https://developers.google.com/analytics/devguides/collection/android/v3/screens). How is it in b4a? The google write this: „To get the most complete screen view data, add the EasyTracker methods to all of the Activities in your app.” Code: Copy public class myTrackedActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public void onStart() { super.onStart(); ... // The rest of your onStart() code. EasyTracker.getInstance(this).activityStart(this); // Add this method. } @Override public void onStop() { super.onStop(); ... // The rest of your onStop() code. EasyTracker.getInstance(this).activityStop(this); // Add this method. } } And this: Code: Copy // May return null if EasyTracker has not yet been initialized with a property // ID. Tracker easyTracker = EasyTracker.getInstance(this); // This screen name value will remain set on the tracker and sent with // hits until it is set to a new value or to null. easyTracker.set(Fields.SCREEN_NAME, "Home Screen"); easyTracker.send(MapBuilder .createAppView() .build() ); Thank you for your help!
Erel B4X founder Staff member Licensed User Longtime User Jun 5, 2014 #6 The Start and Stop methods are the same as the methods in the library. You just need to update the xml file as described in their documentation. Upvote 0
The Start and Stop methods are the same as the methods in the library. You just need to update the xml file as described in their documentation.