首页 \ 问答 \ Firebase + GTM + GA实施问题(Firebase + GTM + GA implementation issue)

Firebase + GTM + GA实施问题(Firebase + GTM + GA implementation issue)

我正在使用iOS Swift 3并尝试在Firebase中跟踪屏幕视图,并将这些数据通过GTM推送到GA中。

我的问题是我无法从推入GA的“screen_view”事件中获取屏幕名称。

在firebase中,初始自动屏幕视图命中没有屏幕名称,只有屏幕类,因此我使用Analytics.setScreenName设置屏幕名称并覆盖屏幕类。

但是,这会导致Firebase中的两次点击,一次自动没有屏幕名称,一次手动触发屏幕名称。

另外,我想将事件中的屏幕名称作为屏幕视图类型传递给GA。 我将GTM中的screenName字段设置为变量。

我已经尝试了变量的各种事件参数

  • “firebase_screen”:结果未在GA中找到和(未设置)
  • “_sn”:在xCode调试中导致“无效的事件参数”

所以我猜所有以_开头的参数都在Firebase中保留。 那么如何从firebase获取保留的事件参数到GA。 例如,我可能希望将App版本存储在自定义维度中。

这里最大的问题是从GTM到GA的屏幕视图中没有显示屏幕名称。


I am using iOS Swift 3 and trying to track screen views in Firebase and push those data into GA with GTM.

My issue is that I cannot get the screen name from "screen_view" events pushed into GA.

In firebase, the initial automated screen view hit has no screen name and only screen class so I used Analytics.setScreenName to set the screen name and override the screen class.

However this causes two hits in Firebase, one automated with no screen name and one manually triggered with screen name.

Also, I want to pass the screen name from the event into GA as a screen view type. I set the screenName field in GTM to a variable.

I have tried various event parameters for the variable

  • "firebase_screen" : results in not found and (not set) in GA
  • "_sn" : results in "invalid event parameter" in xCode debug

So I guess all the parameters that start with _ are reserved in Firebase. So how do I get the reserved event parameters from firebase into GA. For example, I may want to store the App Version in a custom dimension for something.

The biggest problem here is the screen name not picking up in the screenview hit from GTM to GA.


原文:https://stackoverflow.com/questions/45912208
更新时间:2024-03-12 07:03

最满意答案

我不知道为什么AdjustWindowRect不起作用(除非您的客户区包含一个带有一个像素边框的子窗口)。

请注意,您可以将此功能用于重叠窗口。 文档说您不能使用WS_OVERLAPPED样式(我猜因为它的值为零),但您可以使用WS_OVERLAPPEDWINDOW。

作为替代方案,您可以调用GetWindowRect和GetClientRect,计算边框的宽度/高度(两个矩形的宽度/高度之间的差异),将这些添加到所需的客户端大小并设置窗口大小。 我相信你可以在显示窗口之前执行此操作。


My mistake in my case was the following:

AdjustWindowRectEx(&rect, WS_OVERLAPPEDWINDOW, WS_CLIPSIBLINGS, FALSE, WS_OVERLAPPEDWINDOW);

Changing to this fixes it:

AdjustWindowRectEx(&rect, WS_OVERLAPPEDWINDOW, WS_CLIPSIBLINGS, FALSE, 0);

相关问答

更多
  • 给定所需的客户区大小,可以使用AdjustWindowRect或AdjustWindowRectEx函数来计算窗口大小。 You can use the AdjustWindowRect or AdjustWindowRectEx function to calculate the window size given a desired client area size.
  • 您需要使用带有WM_SETFONT消息的SendMessage()在选项卡控件上设置字体。 您可以使用GetStockObject(DEFAULT_GUI_FONT)来获取默认的GUI字体, 您可以使用SystemParametersInfo()来获取默认字体,也可以使用CreateFont()设置不同的字体。 NONCLIENTMETRICS ncm; ncm.cbSize = sizeof(NONCLIENTMETRICS); SystemParametersInfo(SPI_GETNONCLIENTM ...
  • 我不知道为什么AdjustWindowRect不起作用(除非您的客户区包含一个带有一个像素边框的子窗口)。 请注意,您可以将此功能用于重叠窗口。 文档说您不能使用WS_OVERLAPPED样式(我猜因为它的值为零),但您可以使用WS_OVERLAPPEDWINDOW。 作为替代方案,您可以调用GetWindowRect和GetClientRect,计算边框的宽度/高度(两个矩形的宽度/高度之间的差异),将这些添加到所需的客户端大小并设置窗口大小。 我相信你可以在显示窗口之前执行此操作。 My mistake ...
  • 我一直在使用AcceptEx和IOCP,我从未见过这样的问题。 关于你的代码。 由于它不完整,很难说它究竟是什么错误。 但我很确定问题就在那里。 我看到的一个问题是您提供给AcceptEx的第三个参数是本地缓冲区。 这是错误的,因为此缓冲区应在接受操作期间保持有效。 你所做的很容易导致堆栈内存损坏。 但是你的“虚假接受”问题可能是由其他原因造成的。 我怀疑我知道这是什么问题。 让我猜猜: 您对侦听和接受(客户端)套接字使用相同的IOCP。 这是合理的,不需要超过1个IOCP。 当您从IOCP中WORK_AC ...
  • 您手动创建的控件(通过CreateWindowEx)不会自动设置其字体,并默认为“系统字体”(这是您在屏幕截图中看到的)。 相反,您需要在控件的字体创建后设置它。 例如, SendMessage(hGroup2, WM_SETFONT, (WPARAM)SendMessage(hGroup1, WM_GETFONT, 0, 0), TRUE); Controls you create manually (via CreateWindowEx) do not get their font set autom ...
  • MSDN表示您可以将WNDCLASSEX hCursor字段设置为NULL,在这种情况下,您必须在窗口过程中显式设置光标(这意味着处理WM_SETCURSOR消息)。 例如: if (Msg == WM_SETCURSOR && LOWORD(lParam) == HTCLIENT) { SetCursor(NULL); return TRUE; } // Remainder of window procedure code 检查HTCLIENT可确保光标仅隐藏在客户端区域中,并且窗口 ...
  • 基本上,你几乎可以用你的窗户做任何事情。 但大多数技巧都是手动实现的。 什么是“非常敏感”我不知道。 如果您的意思是窗口没有标准边框,则很容易实现:在创建WS_POPUP窗口时不要指定WS_BORDER和WS_CAPTION 。 之后,您将不得不自己绘制边框和标题。 像往常一样处理WM_ERASEBKGND和WM_PAINT消息,绘制背景,菜单。 这种效果在我看来更像是一个bug。 它以这种方式发生:窗口调整大小,它获取WM_SIZE消息,处理它,Windows发送窗口忽略的WM_ERASEBKGND消息。 ...
  • 你不能在Win32中使用cin使用编辑框,然后从字符串中获取用户的输入,然后如果你想将它转换为整数值,则使用API: GetDlgItemInt(...); 你也只在while循环中处理GetMessage,而你只处理循环外部的dispatchmessage,这意味着当getmessage失败时(程序结束),只处理一次dispatchmessage,所以只要没有人需要,结果就是冻结窗口从getmessage到目标windo的消息。 解决方案:在循环中调用DispatchMessage: 另一件事:你通过h ...
  • 1 ..应该找到Widget HWND。 ... hr = m_pIWebBrowser->QueryInterface(IID_IWebViewPrivate, reinterpret_cast(&webViewPrivate)); if (FAILED(hr)) return E_FAIL; hr = webViewPrivate->viewWindow(reinterpret_cast(&m_hudWnd)); if (FAILED(hr) || ...
  • 使用SDL_GetWindowSize ,您可以获取客户端窗口的宽度和高度。 SDL_Window* window = SDL_CreateWindow("Window", 0, 0, 800, 600, 0); int width; int height; SDL_GetWindowSize(window, &width, &height); width = 800,height = 600 Using SDL_GetWindowSize, you can grab the width and heig ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)