• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - Firebase 未触发 Google Tagmanager

[复制链接]
菜鸟教程小白 发表于 2022-12-11 16:51:57 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我已经在我的 iOS 应用中实现了 Firebase。我还添加了 Google Tag Manager,我按照以下说明操作:

数据被发送到 Firebase,因为我在 Firebase Analytics 中看到了我发送的弹出式事件。但是,它似乎并没有触发 Google Tagmanager。 Google Tagmanager 设置为触发 Google Analytics,这也没有发生。

当我在模拟器中尝试预览 URL 时,我在日志中收到以下错误:

2016-06-30 10:33:37.592 MyApp[58890:] <FIRAnalytics/DEBUG> Deep Link does not contain valid required params. URL params: {
        "gtm_auth" = "lmsB-*****************";
        "gtm_preview" = 2;
        id = "GTM-XXXXXX";
    }

但是,我使用容器 ID com.myapp.app,这对于容器和应用程序中的 urlscheme 以及应用程序包 ID 都是正确的。

这是我的代码:

extension AppDelegate: ApiManagerDelegate {

    func didRecieveGTMData(data: AnyObject) {
        if let objects = data as? [[String:AnyObject]] {
            for event in objects {
                if let
                    event = event as? [String:NSObject],
                    name = event["event"] as? String {
                    FIRAnalytics.logEventWithName(name, parameters: event)

                    AppLog("Sending event \(name) to TagManager", logType: .Warning)
                }
            }
        }
    }

}

这是我的日志,已启用调试。

2016-06-30 10:59:51.875: <FIRInstanceID/WARNING> FIRInstanceID AppDelegate proxy enabled, will swizzle app delegate remote notification handlers. To disable add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
"1467284391.876531: application(_:didFinishLaunchingWithOptions - APPS: Optional([__FIRAPP_DEFAULT: <FIRApp: 0x7f916b860dc0>])"
2016-06-30 10:59:51.897 MyApp[63243:] <FIRAnalytics/DEBUG> Debug mode is on
2016-06-30 10:59:51.898 MyApp[63243:] <FIRAnalytics/INFO> Firebase Analytics v.3200000 started
2016-06-30 10:59:51.899 MyApp[63243:] <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http:// goo.gl/Y0Yjwu)
2016-06-30 10:59:51.899 MyApp[63243:] <FIRAnalytics/DEBUG> Debug logging enabled
2016-06-30 10:59:51.900 MyApp[63243:] <FIRAnalytics/DEBUG> Firebase Analytics is monitoring the network status
2016-06-30 10:59:51.904 MyApp[63243:] <FIRAnalytics/INFO> Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
2016-06-30 10:59:51.919 MyApp[63243:] <FIRAnalytics/DEBUG> Successfully parsed a configuration. Version: 1462963036106000
2016-06-30 10:59:51.961 MyApp[63243:] <FIRAnalytics/DEBUG> Firebase Analytics is ready to receive events
2016-06-30 10:59:51.966 MyApp[63243:] <FIRAnalytics/DEBUG> No data to upload. Upload task will not be scheduled
2016-06-30 10:59:51.967 MyApp[63243:] <FIRAnalytics/DEBUG> Cancelling background upload task.
2016-06-30 10:59:51.967 MyApp[63243:] <FIRAnalytics/DEBUG> Scheduling user engagement timer
2016-06-30 10:59:51.967 MyApp[63243:] <FIRAnalytics/DEBUG> Timer scheduled to fire in approx. (s): 3600
2016-06-30 10:59:51.968 MyApp[63243:] <FIRAnalytics/INFO> Firebase Analytics enabled
2016-06-30 10:59:52.162 MyApp[63243:] <FIRAnalytics/DEBUG> Network status has changed. code, status: 2, Connected
2016-06-30 10:59:52.163 MyApp[63243:] <FIRAnalytics/DEBUG> Network status has changed. code, status: 2, Connected
2016-06-30 10:59:52.206 MyApp[63243:] <FIRAnalytics/DEBUG> Received SSL challenge for host. Host: https://play.googleapis.com/log
2016-06-30 10:59:52.458 MyApp[63243:] <FIRAnalytics/DEBUG> Uploading data. Host: https://play.googleapis.com/log
2016-06-30 10:59:52.505 MyApp[63243:] <FIRAnalytics/DEBUG> Received SSL challenge for host. Host: https://play.googleapis.com/log

"⚠️ 1467284414.833250: didRecieveGTMData - Sending event conversionTracking to TagManager"

2016-06-30 11:00:14.856 MyApp[63243:] <FIRAnalytics/DEBUG> Logging event: origin, name, params: app, conversionTracking, {
        "VAR_USER_ID" = 0;
        "_o" = app;
        event = conversionTracking;
        eventAction = Signup;
        eventCategory = Conversion;
        eventId = signup;
        eventLabel = Success;
        eventStatus = success;
        forAffiliates = 1;
        geoCountry = SE;
        nrId = 000000;
        partAccountId = Account;
        partClickId = Click;
        partId = XXXXX;
        partKeywords = Keywords;
        partMarketingId = Marketing;
        plyCountry = SE;
        plyCurrency = SEK;
    }
2016-06-30 11:00:15.009 MyApp[63243:] <FIRAnalytics/DEBUG> Event logged. Event name, event params: conversionTracking, {
        "VAR_USER_ID" = 0;
        "_o" = app;
        event = conversionTracking;
        eventAction = Signup;
        eventCategory = Conversion;
        eventId = signup;
        eventLabel = Success;
        eventStatus = success;
        forAffiliates = 1;
        geoCountry = SE;
        nrId = 000000;
        partAccountId = Account;
        partClickId = Click;
        partId = XXXXX;
        partKeywords = Keywords;
        partMarketingId = Marketing;
        plyCountry = SE;
        plyCurrency = SEK;
    }
2016-06-30 11:00:15.012 MyApp[63243:] <FIRAnalytics/DEBUG> Timer scheduled to fire in approx. (s): 1993.185952067375
2016-06-30 11:00:15.012 MyApp[63243:] <FIRAnalytics/DEBUG> Upload task scheduled to be executed in approx. (s): 1993.185952067375
2016-06-30 11:00:17.054 MyApp[63243:] <FIRAnalytics/DEBUG> Scheduling user engagement timer
2016-06-30 11:00:17.054 MyApp[63243:] <FIRAnalytics/DEBUG> Canceling active timer
2016-06-30 11:00:17.054 MyApp[63243:] <FIRAnalytics/DEBUG> Timer scheduled to fire in approx. (s): 3600
2016-06-30 11:00:17.055 MyApp[63243:] <FIRAnalytics/DEBUG> Canceling active timer
2016-06-30 11:00:17.055 MyApp[63243:] <FIRAnalytics/DEBUG> App will resign active state. Scheduling data upload
2016-06-30 11:00:17.055 MyApp[63243:] <FIRAnalytics/DEBUG> Starting data upload
2016-06-30 11:00:17.057 MyApp[63243:] <FIRAnalytics/DEBUG> Saving bundle. size (bytes): 562
2016-06-30 11:00:17.058 MyApp[63243:] <FIRAnalytics/DEBUG> Bundle added to the upload queue. BundleID, timestamp (ms): 39, 1467277214833
2016-06-30 11:00:17.155 MyApp[63243:] <FIRAnalytics/DEBUG> Uploading events. Elapsed time since last successful upload (s): 1608.957054853439
2016-06-30 11:00:17.156 MyApp[63243:] <FIRAnalytics/DEBUG> Measurement data sent to network. Timestamp (ms), data: 1467277217155, <ACPMeasurementBatch 0x7f916beea360>: {
        bundles {
          protocol_version: 1
          events {
            params {
              name: "partId"
              string_value: "XXXXX"
            }
            params {
              name: "partKeywords"
              string_value: "Keywords"
            }
            params {
              name: "eventAction"
              string_value: "Signup"
            }
            params {
              name: "plyCurrency"
              string_value: "SEK"
            }
            params {
              name: "event"
              string_value: "conversionTracking"
            }
            params {
              name: "partMarketingId"
              string_value: "Marketing"
            }
            params {
              name: "eventStatus"
              string_value: "success"
            }
            params {
              name: "partAccountId"
              string_value: "Account"
            }
            params {
              name: "partClickId"
              string_value: "Click"
            }
            params {
              name: "forAffiliates"
              int_value: 1
            }
            params {
              name: "plyCountry"
              string_value: "SE"
            }
            params {
              name: "eventLabel"
              string_value: "Success"
            }
            params {
              name: "VAR_USER_ID"
              string_value: "0"
            }
            params {
              name: "nrId"
              string_value: "000000"
            }
            params {
              name: "eventId"
              string_value: "signup"
            }
            params {
              name: "_o"
              string_value: "app"
            }
            params {
              name: "eventCategory"
              string_value: "Conversion"
            }
            params {
              name: "geoCountry"
              string_value: "SE"
            }
            name: "conversionTracking"
            timestamp_millis: 1467277214833
            previous_timestamp_millis: 1467273532697
          }
          user_attributes {
            set_timestamp_millis: 1465483501262
            name: "_fot"
            int_value: 1465484400000
          }
          upload_timestamp_millis: 1467277217155
          start_timestamp_millis: 1467277214833
          end_timestamp_millis: 1467277214833
          previous_bundle_end_timestamp_millis: 1467275607927
          platform: "ios"
          os_version: "9.2"
          device_model: "x86_64"
          user_default_language: "en-us"
          time_zone_offset_minutes: 120
          app_store: "manual_install"
          app_id: "com.casinoroom.app"
          app_version: "2.0"
          gmp_version: 3200
          uploading_gmp_version: 3200
          resettable_device_id: "0A4F72DB-4790-4227-899B-463730BC3DA1"
          limited_ad_tracking: false
          app_instance_id: "DF4F87E8B6EB41F497C88995F9E7FE7A"
          bundle_sequential_index: 39
          gmp_app_id: "1:98619240432:ios:e648ebe381ed4c52"
          previous_bundle_start_timestamp_millis: 1467275607927
          firebase_instance_id: "dtPuhg5zGEo"
          app_version_major: 234
        }
    }
2016-06-30 11:00:17.157 MyApp[63243:] <FIRAnalytics/DEBUG> Uploading data. Host: https://app-measurement.com/a
2016-06-30 11:00:17.158 MyApp[63243:] <FIRAnalytics/DEBUG> Logging event: origin, name, params: auto, _e, {
        "_et" = 25056;
        "_o" = auto;
    }
2016-06-30 11:00:17.204 MyApp[63243:] <FIRAnalytics/DEBUG> Received SSL challenge for host. Host: https://app-measurement.com/a
2016-06-30 11:00:17.255 MyApp[63243:] <FIRAnalytics/DEBUG> Event logged. Event name, event params: _e, {
        "_et" = 25056;
        "_o" = auto;
    }
2016-06-30 11:00:17.355 MyApp[63243:] <FIRAnalytics/DEBUG> Do not schedule an upload task. Task already exists
2016-06-30 11:00:17.356 MyApp[63243:] <FIRAnalytics/DEBUG> Successful upload. Got network response. Code, size: 204, 0
2016-06-30 11:00:17.356 MyApp[63243:] <FIRAnalytics/DEBUG> Do not schedule an upload task. Task already exists
2016-06-30 11:00:17.357 MyApp[63243:] <FIRAnalytics/DEBUG> Starting data upload
2016-06-30 11:00:17.358 MyApp[63243:] <FIRAnalytics/DEBUG> Saving bundle. size (bytes): 309
2016-06-30 11:00:17.359 MyApp[63243:] <FIRAnalytics/DEBUG> Bundle added to the upload queue. BundleID, timestamp (ms): 40, 1467277217021
2016-06-30 11:00:17.359 MyApp[63243:] <FIRAnalytics/DEBUG> Uploading events. Elapsed time since last successful upload (s): 0.00379490852355957
2016-06-30 11:00:17.360 MyApp[63243:] <FIRAnalytics/DEBUG> Measurement data sent to network. Timestamp (ms), data: 1467277217359, <ACPMeasurementBatch 0x7f916f0a6020>: {
        bundles {
          protocol_version: 1
          events {
            params {
              name: "_et"
              int_value: 25056
            }
            params {
              name: "_o"
              string_value: "auto"
            }
            name: "_e"
            timestamp_millis: 1467277217021
            previous_timestamp_millis: 1467275607927
          }
          user_attributes {
            set_timestamp_millis: 1465483501262
            name: "_fot"
            int_value: 1465484400000
          }
          upload_timestamp_millis: 1467277217359
          start_timestamp_millis: 1467277217021
          end_timestamp_millis: 1467277217021
          previous_bundle_end_timestamp_millis: 1467277214833
          platform: "ios"
          os_version: "9.2"
          device_model: "x86_64"
          user_default_language: "en-us"
          time_zone_offset_minutes: 120
          app_store: "manual_install"
          app_id: "com.casinoroom.app"
          app_version: "2.0"
          gmp_version: 3200
          uploading_gmp_version: 3200
          resettable_device_id: "0A4F72DB-4790-4227-899B-463730BC3DA1"
          limited_ad_tracking: false
          app_instance_id: "DF4F87E8B6EB41F497C88995F9E7FE7A"
          bundle_sequential_index: 40
          gmp_app_id: "1:98619240432:ios:e648ebe381ed4c52"
          previous_bundle_start_timestamp_millis: 1467277214833
          firebase_instance_id: "dtPuhgXXXXX"
          app_version_major: 234
        }
    }
2016-06-30 11:00:17.361 MyApp[63243:] <FIRAnalytics/DEBUG> Uploading data. Host: https://app-measurement.com/a
2016-06-30 11:00:17.404 MyApp[63243:] <FIRAnalytics/DEBUG> Received SSL challenge for host. Host: https://app-measurement.com/a
2016-06-30 11:00:17.408 MyApp[63243:] <FIRAnalytics/DEBUG> Successful upload. Got network response. Code, size: 204, 0
2016-06-30 11:00:17.409 MyApp[63243:] <FIRAnalytics/DEBUG> Do not schedule an upload task. Task already exists
2016-06-30 11:00:17.411 MyApp[63243:] <FIRAnalytics/DEBUG> No data to upload. Upload task will not be scheduled
2016-06-30 11:00:17.412 MyApp[63243:] <FIRAnalytics/DEBUG> Canceling active timer
2016-06-30 11:00:17.412 MyApp[63243:] <FIRAnalytics/DEBUG> Cancelling background upload task.

我的问题:我错过了什么?我还需要配置什么吗?代码中遗漏了什么?



Best Answer-推荐答案


我遵循了同样的指示。对我来说不明显的是,您必须在 GTM 中设置至少一个 tag(不仅仅是变量)。创建标签会提示您连接到 GA 帐户 ID。在我设置标签并在我的应用程序中更新我的 GTM 配置文件后,从我的模拟器中删除旧应用程序并重新运行它,我在日志中看到这种类型的输出,现在引用我的 GA 帐户 ID,这是以前没有的.事实上,我可以实时看到流向 Analytics 的事件。

2017-10-18 15:24:01.270736-0600 HelloAnalytics[11786:1427214] GoogleTagManager info: Sending universal analytics hit: {
"&ea" = "_vs";
"&ec" = HelloAnalytics;
"&ni" = 0;
"&t" = event;
"&tid" = "UA-XXXXXXXXX-1";

}

关于ios - Firebase 未触发 Google Tagmanager,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38118535/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap