Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install google tag manager SDK into swift project

Im trying to install the google tag manager sdk into my iOS app using swift. I've followed the instructions here Getting Started Guide for Swift. On Section 3:Add a bridging header for Objective-C libraries. Step 7: Add these import statements to the header file:. I tried importing code into my bridging header file but when I try and build it comes up with an error that reads 'TagManager.h' file not found. - How do I solve this error and use google tag manager in swift?

like image 220
kevinabraham Avatar asked May 19 '16 06:05

kevinabraham


People also ask

Is Google Tag Manager a plugin?

Google Tag Manager for WordPress. This plugin allows you to deploy analytics and marketing tags for free. You do not need to spend a single penny to use this GTM. It has the essential features and functionalities to help you maintain your website professionally.


1 Answers

I had checked Googledeveloper site given in your link.Give it a try by just adding your project name inftont of the BridgingHeader.h in Build Settings it may work. Eg: HippiTap/BridgingHeader.h

UPDATE: Tag Manager 5.0.6

  1. At last found the reason for this issue,google has updated its TagManager pod file but not updated its tutorial
  2. If you use pod 'GoogleTagManager’ in your pod file it will install the latest available pod (i.e)5.0.6
  3. This version does't contain necessary file to import in BridgingHeader.h file as shown in https://developers.google.com/tag-manager/ios/v3/swift#add-bridging-header.If we use 5.0.6 pod file in xcode will look like below,

    enter image description here

  4. To solve this we have to reduce the version of TagManager.Now replace

    pod 'GoogleTagManager’ 
    

    with

    pod 'GoogleTagManager’,’~> 3.15.0’
    

    Now run pod intall in your terminal,

    Installing GoogleTagManager 3.15.0 (was 5.0.6)
    
  5. By changing the version of tag manager we are free to go by google's tutorial here .

  6. Now the pod file will look like below

    enter image description here

    I think this may help you.give it a try and let me know the result.

like image 178
Gokul G Avatar answered Nov 07 '22 09:11

Gokul G