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

扶醉桌前 提交于 2019-11-30 04:38:56

问题


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 !


回答1:


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.



来源:https://stackoverflow.com/questions/41807340/googletagmanager-warning-no-default-container-found-container-needs-to-be-adde

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!