1
votes

I am implementing Google Tag Manager for Android Application V4 as requested by my Marketing team for future use,and I have never worked on GTM for websites so I am naive in this context.

I have created account and Container and tags according to instructions on official site. I have linked tag manager with google analytics tracking id. I have written code in my application according to instructions on website and downloaded container to raw folder.

When I run my app it gives me warning and verbose in logcat

W/GoogleTagManager﹕ Resource is a UTF-8 encoded string but doesn't contain a JSON container

D/GoogleTagManager﹕ resource not on disk

Now I am not sure what is the problem here,and data is not reflected in analytics as well.

1

1 Answers

5
votes

enter image description hereIf you are following those steps carefully then this warning doesn't stop you from opening container or sending data to analytics. I am also following instructions available here. I'm getting these logs

  W/GoogleTagManager(3101): Failed to extract the container from the resource file. Resource is a UTF-8 encoded string but doesn't contain a JSON container
  V/GoogleTagManager(3101): The container was successfully loaded from the resource (using binary file)

Follow this link to create Macros and Tags. http://online-behavior.com/analytics/mobile-apps-tag-manager

Look carefully if you have created firing rules for you tags. Also verify if you have published your Container. Try opening your container in onCreate() method.

In GTM V4 after opening container in onCreate(), preferred way is that you need to push your event like this in your onStart() method.

 DataLayer mDataLayer = TagManager.getInstance(this).getDataLayer();
 mDataLayer.pushEvent("your event name here", DataLayer.mapOf("screenName",SCREEN_NAME));

Update: I have attached image to show how I'm changing Basic Configuration. Hope this helps.