GoogleTagManager警告:找不到默认容器。容器需要添加到容器文件夹并添加到目标 [英] GoogleTagManager warning: No default container found. Container needs to be added to a container folder and added to the target

查看:739
本文介绍了GoogleTagManager警告:找不到默认容器。容器需要添加到容器文件夹并添加到目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的Swift应用中尝试实施Google Tag Manager v5时,遇到了以下警告: GoogleTagManager警告:找不到默认容器。容器需要被添加到一个容器文件夹,并添加到目标。

这花了我更多的时间,我的问题的答案很难找到,而不是在这个,所以我决定创建这个问答,万一有些人会和我一样的情况!

iOS ,而不是 iOS(旧版) 在这里:

现在,您只需导入刚创建的文件夹: / b>


  • 右键单击到Xcode文件树中

  • 将文件添加到MyProject
  • 点击容器文件夹

  • 然后选择按钮


    • 选择创建文件夹引用

    • 选择也复制项目如果需要的话
    • 选择您的目标
  • li>
  • 点击添加按钮。



现在一切都应该按照预期工作!为了确保您做得正确,容器文件夹应该在Xcode文件树中显示为蓝色文件夹,而不是黄色。 b $ b

While trying to implement Google Tag Manager v5 in my Swift app, I faced the following warning, which caused me some troubles :

GoogleTagManager warning: No default container found. Container needs to be added to a container folder and added to the target.

It took me more time than it should have, and since the answer for my problem was pretty hard to find and was not on SO, I decided to create this Q&A, in case some people would be in the same situation as mine !

解决方案

First, make sure you're using the correct GTM container type : it should be displayed as iOS, not as iOS (legacy) here : https://tagmanager.google.com/?hl=en#/home

Then, create a folder named container in your project, and download your actual container in it.

Now, you just have to import the folder you just created :

  • right click into Xcode file tree
  • "Add files to 'MyProject'"
  • click the container folder
  • then the options button
    • select create folder reference
    • select also copy items if needed
    • select your targets
  • click the add button.

Everything should work as expected now ! In order to be sure you made things right, the container folder should appear as a blue folder in your Xcode file tree, not as a yellow one.

这篇关于GoogleTagManager警告:找不到默认容器。容器需要添加到容器文件夹并添加到目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆