Skip to content

lqd-io/liquid-events-interceptor-ios

Repository files navigation

Liquid Events Interceptor

Quick way to integrate Liquid basic analytics using your current Localytics or Mixpanel integration.

With this Pod installed, all events being tracked by Localytics or Mixpanel will also be automatically tracked by Liquid, as well as user attributes.

Install

  1. Install CocoaPods in your system.

  2. Open your Xcode project folder and create/edit a file called Podfile with the following content, depending on the analytics service you're already using. Use only one of them:

    pod 'LiquidEventsInterceptor/Localytics'
    pod 'LiquidEventsInterceptor/Mixapanel'
    pod 'LiquidEventsInterceptor/GoogleAnalytics'
  3. Run pod install and wait for CocoaPod to install Liquid SDK.

  4. Open your AppDelegate.m, and initialize Liquid, before initializing your current analytics service:

If your using Localytics:

// AppDelegate.m
#import "AppDelegate.h"
#import <Localytics/Localytics.h>
#import <Liquid/Liquid.h>
#import "LiquidLocalyticsInterceptor.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [Liquid sharedInstanceWithToken:@"YOUR-LIQUID-TOKEN"]; // before Localytics
    [Localytics autoIntegrate:@"YOUR-LOCALYTICS-APP-KEY" launchOptions:launchOptions];
    return YES;
}

If you're using Mixpanel:

// AppDelegate.m
#import "AppDelegate.h"
#import <Mixpanel/Mixpanel.h>
#import <Liquid/Liquid.h>
#import "LiquidMixpanelInterceptor.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [Liquid sharedInstanceWithToken:@"YOUR-LIQUID-TOKEN"]; // before Mixpanel
    [Mixpanel sharedInstanceWithToken:@"YOUR-MIXPANEL-TOKEN"];
    return YES;
}

If you're using Google Analytics:

// AppDelegate.m
#import "AppDelegate.h"
#import <Google/Analytics.h>
#import <Liquid/Liquid.h>
#import "LiquidMixpanelInterceptor.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [Liquid sharedInstanceWithToken:@"YOUR-LIQUID-TOKEN"]; // before Google Analytics

    // Configure tracker from GoogleService-Info.plist.
    NSError *configureError;
    [[GGLContext sharedInstance] configureWithError:&configureError];
    NSAssert(!configureError, @"Error configuring Google services: %@", configureError);
    GAI *gai = [GAI sharedInstance];
    gai.trackUncaughtExceptions = NO;
    gai.logger.logLevel = kGAILogLevelError;

    return YES;
}

Full integration

To use all the Liquid features please integrate our SDK.

We recommend you to read the full documentation.

Author

Liquid Data Intelligence, S.A.

License

Liquid is available under the Apache license. See the LICENSE file for more info.

About

Liquid Events Interceptor for iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published