I'm integrating Google Tag Manager for my iOS Application. I downloaded all the required file which are : TAGManager.h
, TAGContainer.h
, TAGContainerOpener.h
, TAGDataLayer.h
, TAGLogger.h
When I added these in my project, the code compiles but when it starts linking then it throws error as below:
Undefined symbols for architecture arm64:
"OBJC_CLASS$_TAGContainerOpener", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I added below code in AppDelegate.swift file:
TAGContainerOpener.openContainer(withId: "GTM-PT3L9Z",
tagManager: GTM, openType: kTAGOpenTypePreferFresh,
timeout: nil,
notifier: self)
Could anyone please tell me why I get this linking error.
I believe you might be using an old implementation. The newest version is v5 (Firebase + GTM), here is the docs.