Preview & Update version of GTM Container | iOS

2019-07-12 03:15发布

问题:

i've integrated google tag manager in my iOS app. I'm stuck at some points:

  1. How to preview the version before making it live.I followed this link & added the urls in plist file. How to do the following step mentioned on this link

    Stop your application and open the preview URL on an emulator or physical device to preview the draft container in your application.

  2. It's said that we don't have to submit a new binary & GTM version is updated in app automatically. How? I've not written any code to refresh the container.

Thanks,

回答1:

I just tried to use the container preview as you asked me to ;) It seems that it was working for me, so I'm gonna try to explain the step for you to follow in order to make it work.

  1. The step you seem to be stuck at is pretty easy, and I achieved it on the simulator :

    1. Launch your app on the simulator by clicking on the play button on the top left of XCode :

      Click on the play button (1) once you've set the simulator as the build target (2).

    2. Wait until the simulator launches your app. Once it is done, press the following keys once to go back to the iphone home page :

      cmd+shift+H

      Pressing it two times will allow you to kill the app on the background by swipping your app from bottom to top with your mouse.

    3. Open safari on the emulator, and paste the url you copied on the Share preview popup of GTM :

      If everything has been correctly set up, it will ask you if you want to open it in your app, just click yes, and you're done !

  2. For your second question, if I understand well, the only fact that you create a version without publishing it allows you to preview it with the link created. The GTM SDK has been designed to work this way, the link you use will probably force the refresh the container by itself to the last version, even if it is not live.

If I remember well, GTM now uses Firebase as DataLayer and send some events automatically, like the applicationStart, which may trigger a method to refresh the container. I'm not 100% sure about it, since I'm more used to the previous GTM version and I don't really work on a GTM project anymore now.

Anyway, I hope it helps you. Good luck with GTM :)



回答2:

We're working on implementing GTM+Firebase for our iOS app and we've been testing the implementation for a few days now. The approach has been to check the FireBase DebugView to see the events are firing properly and they're tagged with firebase_event_origin = app+gtm

Should note that we've done this selectively for 'Enhanced Ecommerce' reporting only. Don't know if anyone else has gone over that and been able to find an easy way to verify that. For us, apart from the above, we'd then wait and see if the data has appeared on the Ecommerce reports on GA. Found the debug information was hard to follow.

AS for the second part re: empty container, usually the app downloads the last published one, except yesterday, where since morning no data was appearing on GA and debug logs weren't showing if the GTM-XXXX container was being loaded. By the close of day however the GA reports showed every transaction we performed during the day!