1
votes

i'm trying to use Google tag manager with Firebase analytics in my iOS project using this link. However, i'm not sure how can i test Google tag manager.

What i'm trying to do is to block some of the firebase analytics, so that i may have idea that GTM is working.

My code is:

@IBAction func logAnalytics(sender: UIButton) {

    var parameters = [String: NSObject]()
    parameters[kFIRParameterItemCategory] = "ViewController"
    parameters[kFIRParameterContentType] = "logAnalyticsEvent"
    parameters[kFIRParameterItemID] = nil

    FIRAnalytics.logEventWithName(kFIREventSelectContent, parameters: parameters)
}

How i'm doing it on GTM console:

I created container (iOS) on GTM. Created variable, triggers and tag. Trigger for content_type contains 'logAlanyticsEvent'. And the tag to block these events.

Questions:

  1. These events are not being blocked. What i'm doing wrong? You can find GTM live version file on this link
  2. 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.

  1. 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.

Please help.

1

1 Answers

1
votes

The other 2 questions(#2, #3) are not answered yet. Where as i was able to fix #1.

#1 i found out that there was no container folder in my project. i placed the JSON file in root directory of my project. Steps are:

  1. Create 'container' folder in your project (this step is important)
  2. Add downloaded JSON file in this folder
  3. Add this folder in your project (in xcode). Please note, folder's color must be blue (not yellow).
  4. Referance: I used this link to solve this issue.