Campaign management, Crash & Exception tracking using GTM

I'm trying to implement Google Analytics Campaign Management and Crash & Exception tracking using Google Tag Manager in Android. I found Google Analytics documentation for Campaign Management and Crash & Exception tracking.

Links:

https://developers.google.com/analytics/devguides/collection/android/v4/campaigns https://developers.google.com/analytics/devguides/collection/android/v4/exceptions

But I didn't find any documentation for implementing the same thing using Google Tag Manager. Please suggest if there is any other way to track these things using GTM.


Google Analytics Campaign Management

As far as I know, you need to map campaign parameters variables such as source and medium yourself, that's how GTM provides flexibility. On Android, we usually implement a function like :-

 public static void trackCampaign(String uri_string)
{
    Uri uri = Uri.parse(url_string);

    DataLayer dataLayer = TagManager.getInstance(getAppContext()).getDataLayer();
    dataLayer.pushEvent("campaignTracking",
                                          DataLayer.mapOf("screenName", screenName,
                                                                        "source", uri.getQueryParameter("utm_source"),
                                                                        "medium", uri.getQueryParameter("utm_medium"));
}

On the GTM dashboard you can use the "Fields to set" parameters to set campaign parameters such as source and medium. Please see the image below for reference. 在这里输入图像描述

**Google Analytics Crash & Exception tracking **

To track crashes and exceptions one can add a Google Analytics event on a "Crash" trigger. The crash trigger can be set while handling exception. The GA event can be set in a way such that.

Event Category= Error
Event Action = screenName
Event Label = Stack trace 
链接地址: http://www.djcxy.com/p/81338.html

上一篇: 谷歌分析跟踪混合科尔多瓦应用程序

下一篇: 广告系列管理,使用GTM进行崩溃和例外跟踪