I've a problem with the google Event Tracker. Following the official documentation Google develop Documentation i add the xml file with my id. After on the activity i create a new Tracker, and try to push a new event, but the method "sendevent" does not exist.
this is my code
The import:
import com.google.analytics.tracking.android.EasyTracker;
import com.google.analytics.tracking.android.GoogleAnalytics;
import com.google.analytics.tracking.android.Tracker;
//I think i've to only import the tracker
and the simple code
Long opt_value;
Tracker MyTracker;
MyTracker.sendEvent("ui_action", "button_press", "play_button", opt_value);
And the error:
The method sendEvent(String, String, String, Long) is undefined for the type Tracker
Thank's to all and sorry for my bad english
Edit: Now i'm tryng with
MyTracker.send(MapBuilder
.createEvent("evt",
"Id",
""+idSong,
null).build()
);
but on logcat i have: 08-20 10:45:35.320: I/GAV3(5371): Thread[GAThread,5,main]: No campaign data found.
To use sendEvent method you should first initialize the tracker like:
The above code works with V2 lib , to work with V3 use: