Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOs: Swift Google Analytics

I am new to iOs development and would like to implement Google Analytics (swift).

It appears there is some missing information on implementing Google Analytics in swift on Google's instruction page:

enter image description here

It seems the import statement above is incorrect, can anyone assist me with the missing/correct statement?

Exta Info:

  • I come from a Java background and IDEs I use import for you, so please excuse my stupidity.
  • I have cocopods installed, and use other pods: Almofire, Fabric, swiftyJson etc
  • I am developing for iOs 8
  • Instructions above this, are clear and working. Installing the pods/config file etc
like image 350
iamanyone Avatar asked Nov 19 '25 14:11

iamanyone


1 Answers

In your Objective-C bridging header file, You should import GA header files:

#import "GAI.h"
#import "GAIDictionaryBuilder.h"
#import "GAIEcommerceFields.h"
#import "GAIEcommerceProduct.h"
#import "GAIEcommerceProductAction.h"
#import "GAIEcommercePromotion.h"
#import "GAIFields.h"
#import "GAILogger.h"
#import "GAITrackedViewController.h"
#import "GAITracker.h"

I am not sure if I am missing some import.

like image 152
agy Avatar answered Nov 22 '25 02:11

agy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!