简体   繁体   English

Google Analytics不支持GTM和Firebase iOS

[英]Google Analytics not working with GTM and Firebase iOS

I installed Firebase SDK to my project. 我在我的项目中安装了Firebase SDK。 I'm using Firebase "logEventWithName" method to send event to GTM. 我正在使用Firebase“logEventWithName”方法将事件发送到GTM。 I see that events are logged. 我看到记录了事件。 I see output in debug console in xcode. 我在xcode的调试控制台中看到了输出。

016-06-30 14:49:13.991 Reztoran[47264:3499021] GoogleTagManager info: Processing logged event: pageView with parameters: {
pageName = Restaurant;
}
2016-06-30 14:49:13.995 Reztoran[47264:3499021] GoogleTagManager info: Sending universal analytics hit: {
"&t" = screenview;
"&tid" = "xxxxxxxxxxx";
}
2016-06-30 14:49:13.997 Reztoran[47264:] <FIRAnalytics/DEBUG> Logging event: origin, name, params: app+gtm, pageView, {
    "_o" = "app+gtm";
    pageName = Restaurant;
}
2016-06-30 14:49:14.079 Reztoran[47264:] <FIRAnalytics/DEBUG> Event logged. Event name, event params: pageView, {
    "_o" = "app+gtm";
    pageName = Restaurant;
}

I created a Trigger which fires on when Event Name equals to pageView and I created a Google Analytics tag that's Track Type is ScreenView and fires on the event that I created. 我创建了一个触发器,当事件名称等于pageView时触发,我创建了一个Google Analytics标签,其轨道类型是ScreenView,并触发我创建的事件。

I could not see any data in Google Analytics however I can see all the events and data in firebase console. 我在Google Analytics中看不到任何数据,但我可以在firebase控制台中看到所有事件和数据。

What could be the reason of this problem? 这个问题可能是什么原因?

I don't have experience with Firebase, but I use Google Tag Manager to Implement Google Analytics I attached images you can see how i created (Variable, Trigger, Tag, please consider red rectangles others are extra) in google tag manager account, below is the code i use in page life cycle methods (viewDidAppear and viewWillDisappear) and please make sure downloaded the correct container. 我没有使用Firebase的经验,但我使用Google 跟踪代码管理器来实施Google Analytics我附加的图片您可以在google标记管理器帐户中看到我创建的方式(变量,触发器,标记,请考虑其他的红色矩形)是我在页面生命周期方法(viewDidAppear和viewWillDisappear)中使用的代码,请确保下载了正确的容器。 在此输入图像描述 在此输入图像描述 在此输入图像描述 在此输入图像描述

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    // The container should have already been opened, otherwise events pushed to
    // the data layer will not fire tags in that container.
    TAGDataLayer *dataLayer = [TAGManager instance].dataLayer;
    [dataLayer push:@{@"event": @"openScreen1", @"screenName": @"Wellcome Screen"}];

}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    //[Utils pushCloseScreenEventWithScreenName:@"CategoryViewScreen"];

    TAGDataLayer *dataLayer = [TAGManager instance].dataLayer;
    [dataLayer push:@{@"event": @"closeScreen", @"screenName": @"Wellcome Screen"}];

}

Below are the screen shots of reflected results on GOOGLE ANALYICS 以下是GOOGLE ANALYICS上反映结果的屏幕截图 在此输入图像描述 在此输入图像描述

GoogleAnalytics screen views require a screen name (the content description variable cd). GoogleAnalytics屏幕视图需要屏幕名称 (内容描述变量cd)。 Another thing to keep in mind is that Google Analytics sends data in batches, so it can take minutes before screen views show up in real time. 另外需要注意的是,Google Analytics会分批发送数据,因此在屏幕视图实时显示之前可能需要几分钟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM