0

I found how use GTMv4 for GA and GTMv5 for FA, but no any information for v5+GA (for web side little bit more information).

is the correct replacement(in each case)?

Case 1:

Bundle params = new Bundle();
params.putString("screenName", screenName);
params.putString("screenID", screenID);
df.logEvent("openScreen", params);

from

getDefaultTracker().setScreenName(screenName);
getDefaultTracker().send(new HitBuilders.ScreenViewBuilder()
                         .setCustomDimension(3, screenID);

Case 2:

Bundle params = new Bundle();
params.putString("category", getCategory());
params.putString("action", getAction());
params.putString("label", getLable());
params.putInt("value", 0);
params.putString("name", "start");
df.logEvent("event", params);

from

getDefaultTracker().send(new HitBuilders.EventBuilder()
            .setCategory(getCategory())
            .setAction(getAction())
            .setLabel(getLable()))
            .setValue(0)
            .setCustomDimension(2, "Start")
            .build());

So, how need configure tag? In manual for v4->ga we have Variable type "Data Layer Variable".What is analog for GTMv5?

Also, where I could get all key for bind data? enter image description here img from manual v4, but i can't find similar information in v5

From manual:

Event Name: The value is set to "eventNameXYZ" when the following code in your app is executed:

Android:
FirebaseAnalytics.getInstance(mContext).logEvent("eventNameXYZ", null);

but how to set value? I can create only "new variable" with "Title". Or need set name equal key, e.g. "eventNameXYZ"?

Secondary Question:

It possible to use GTM+Firebase for save data in local storage?

Update

aghhhr, why divided radio buttons? + Custom parameter looks like hint :( enter image description here

sergii.gudym
  • 163
  • 1
  • 13

1 Answers1

0

If you're trying to send Universal Analytics hits from firebase, then case 1 and case 2 both look correct, though you might want to be more specific about the name of the event in case 2. If the event you're recording is equivalent to one of the suggested Firebase Analytics events, then consider using that as the event name, instead of the more generic name event.

To setup a GA tag to fire for these logEvent calls, you'll want to create "Event Parameter" variables for each of the event parameters you're using. For example, to capture the screen name you're including in case 1, you would setup an EventParameter like this: an event parameter configured with custom parameter set to screenName

For the tag setup, you just use the screenName variables as the values in fields to set, event variables, or custom dimensions. For screen views, be sure to provide a screen name, as it's required for a screen view. Universal Analytics tag using Screen Name variable

To trigger the Universal Analytics tag, you would setup a trigger for event name. In the first case, the trigger setup would look like this: a trigger with eventName equal to openScreen.

And to answer your second question, You can use Firebase user properties to store data in local storage, report it to firebase, and make it available to GTM via the Firebase User Property variable type.

Eric Burley
  • 576
  • 2
  • 3
  • sorry, my second question is no clear. I wanna remove my logger(for bug hunting). So, is it possible use your dataLayer(logEvent) for storing data to file(my path)? Or maybe give advice to use other mechanism(troubleshooting). Currently it look like : params.putString("bluetoothType", "standart"); params.putInt("attempt", 3); df.logEvent("connect", params); + Logger(TAG, "bluetoothType->"+ "standart" + " attempt " + 3) – sergii.gudym Aug 21 '16 at 11:20
  • Logger.debug(TAG, "bluetoothType->"+ "standart" + " (attempt " + 3+")")* – sergii.gudym Aug 22 '16 at 08:42
  • So you'd like to replace your logging by using GTM to log? For Android I'd recommend sticking with the stock logger. Doing this integrates well with the tools, and you can even optimize out the debug level logging with proguard (http://stackoverflow.com/questions/13218772/removing-log-call-using-proguard). – Eric Burley Aug 22 '16 at 16:17
  • logs need for remote debug(from users). I can't use logcat for this goals :( – sergii.gudym Aug 24 '16 at 13:27
  • So you're trying to remove the redundancy of logging events to Firebase/GTM and console logging? To me these seem like separate concerns. Analytics events are reported in aggregate, so debugging a user problem with them isn't straightforward. You could write a small facade class that makes both calls, and reduce clutter in your codebase. – Eric Burley Sep 08 '16 at 19:53