Skip to content

gimbalinc/adobe-analytics-integration

Repository files navigation

Gimbal Adobe Analytics Integration

This sample project shows how Gimbal can be integrated with Adobe Analytics.

In this integration information regarding Place events are sent to Adobe Analytics. You can than use this information from within Adobe's analytic tools.

Setup

Please refer to the hello-gimbal-ios for generic Gimbal setup and dependencies. We use CocoaPods to install our SDK.

pod 'Gimbal'

You will need to enter your Gimbal API Key into the AppDelegate.swift file.

You will need to add your Adobe libraries and configuration into the project. This includes the following:

  • ADBMobileConfig.json
  • ADBMobile.h
  • ADBMobileLibrary.a

And link the ADBMobileLibrary.a to the application target.

For more detailed information see the Adobe Documentation

GimbalAdobeAnalyticsAdapter

To make integration easier we have created a helper class GimbalAdobeAnalyticsAdapter that exposes a simple method

GimbalAdobeAnalyticsAdapter.sharedInstance.startGimbalAndLogEvents("PUT_YOUR_GIMBAL_API_KEY_HERE")

By invoking this method with the appropriate Gimbal API key both frameworks are initialized and place events are monitored and sent to Adobe.

The code for GimbalAdobeAnalyticsAdapter shows how Place events are sent to Adobe.

import Foundation

class GimbalAdobeAnalyticsAdapter: NSObject, GMBLPlaceManagerDelegate {
    
    static let sharedInstance = GimbalAdobeAnalyticsAdapter()
    var placeManager: GMBLPlaceManager!
    
    override init() {
        super.init()
        placeManager = GMBLPlaceManager()
        self.placeManager.delegate = self
    }
    
    func startGimbalAndLogEvents(gimbalApiKey: String, debugLoggingEnabled:Bool = false) {
        Gimbal.setAPIKey(gimbalApiKey, options: nil)
        Gimbal.start()
        ADBMobile.setDebugLogging(debugLoggingEnabled)
        ADBMobile.collectLifecycleData()
    }
    
    func placeManager(manager: GMBLPlaceManager!, didBeginVisit visit: GMBLVisit!) -> Void {
        NSLog("Begin Gimbal Visit for %@", visit.place.description)
        ADBMobile.trackAction("gimbal.place.visit.begin", data:  self.visitData(visit))
    }
    
    func placeManager(manager: GMBLPlaceManager!, didEndVisit visit: GMBLVisit!) -> Void {
        NSLog("End Gimbal Visit for %@", visit.place.description)
        ADBMobile.trackAction("gimbal.place.visit.end", data: self.visitData(visit))
    }
    
    func visitData(visit: GMBLVisit!) -> Dictionary<String,String> {
        return ["gimbal.place.visit.visitID":visit.visitID,
                "gimbal.place.visit.placeName":visit.place.name,
                "gimbal.place.visit.placeID":visit.place.identifier];
    }
    
}

About

Basic Gimbal iOS Sample Integration with Adobe Analytics

Resources

License

Stars

0 stars

Watchers

7 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors