1

I am trying to implement Google Analytics in ios the logs shows that the data is sent but nothing shows in the Google Analytics console

code login screen

override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        guard let tracker = GAI.sharedInstance().defaultTracker else { return }
        tracker.set("login screen", value: "loginname")

        guard let builder = GAIDictionaryBuilder.createScreenView() else { return }
        tracker.send(builder.build() as [NSObject : AnyObject])

    }

app delegte fe didFinishLaunchingWithOptions

guard let gai = GAI.sharedInstance() else {
            assert(false, "Google Analytics not configured correctly")
        }


        gai.tracker(withTrackingId: "UA-*********-1")
        GAI.sharedInstance().defaultTracker = gai.tracker(withTrackingId: "UA-**********-1")
        // Optional: automatically report uncaught exceptions.
        gai.trackUncaughtExceptions = true

        // Optional: set Logger to VERBOSE for debug information.
        // Remove before app release.
        gai.logger.logLevel = .verbose;

podfile

pod 'GoogleAnalytics'

the logs enter image description here

Mohamed Mo'nes
  • 420
  • 3
  • 14

1 Answers1

0

There's a delay for the data. Try waiting for 24 hours. Anything show in the "realtime" data?

XTOTHEL
  • 5,098
  • 1
  • 9
  • 17