Google Analytics provides event tracking and advanced reporting capabilities to gain insight into your data sets.
The following guide explains how to associate a UXCam URL with Google Analytics event enabling you to see a step by step session replay for your every event.
Sign up and Integrate UXCam
UXCam website will walk you through how to sign up and set up UXCam. To create an Google Analytics account, visit Google Analytics website.
Setup Google Analytics for Integration
- On Google Analytics, navigate to Admin. Then, in the Property column, select Custom Definitions -> Custom Dimension
- Click +New Custom Dimension
- Name the custom Dimension "UXCam session URL".
- You will see the new dimension on Custom Dimension list. Please note the INDEX of this, as we will be using it on the next step to replace it with CUSTOM_DIMENSION_INDEX_FROM_GOOGLEANALYTICS
Integrate with Google Analytics
/* Import UXCam and Google Analytics header at the top of your AppDelegate.m */
#import "GAI.h"
#import "GAIFields.h"
#import "GAIDictionaryBuilder.h"
#import <UXCam/UXCam.h>
/* Add this call as the first line of your application:didFinishLaunchingWithOptions: method */
[UXCam startWithKey:@"App-key from https://www.uxcam.com" appVariantIdentifier:nil completionBlock:^(BOOL started) {
//Tag your Google Analytics events with UXCam recording URLS. Example:
NSMutableDictionary *uxcamURL = [NSMutableDictionary dictionary];
[uxcamURL setValue:[UXCam urlForCurrentSession] forKey:@"UXCam: Session Recording link"];
id tracker = [[GAI sharedInstance] defaultTracker];
[tracker set:[GAIFields customDimensionForIndex:CUSTOM_DIMENSION_INDEX_FROM_GOOGLEANALYTICS] value:uxcamURL];
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"UXCam" action:@"Init" label:nil value:nil] build]];
}];
// Inside onCreate method of all activity that is an entry point to your app add
UXCam.startWithKey("App-key from UXCam");
UXCam.addVerificationListener(new UXCam.OnVerificationListener() {
@Override
public void onVerificationSuccess() {
//Tag your Google Analytics events with UXCam recording URLS. Example:
JSONObject eventProperties = new JSONObject();
try {
eventProperties.put("UXCam: Session Recording link", UXCam.urlForCurrentSession());
} catch (JSONException exception) {
}
tracker.set(Fields.customDimension(CUSTOM_DIMENSION_INDEX_FROM_GOOGLEANALYTICS),eventProperties); }
@Override public void onVerificationFailed(String errorMessage) { } });