FullStory Integration with Google Analytics Technical Guide - Mobile

 

Overview

Google Analytics (GA) is an analytics service that tracks and reports traffic through your application. (In the FullStory app settings there is a switch for GA for use on a website, the guide for this can be found here.)

Adding a FullStory Session URL to your funnel or drop-off reports gives you instant access to the sessions associated with your GA Reports.

Integrations

Sending a FullStory URL of a session with GA events:

Use Cases

With a session URL embedded in an GA Event getting visual feedback on the users actions leading up to the event and or why it may have taken time to checkout etc.

Screen_Shot_2020-07-31_at_10.31.01_AM.png

Sometimes the sessionURL can be too long for the string presentation so you will want to maybe only present pass the session id. To do this you can use the `FS.currentSession` computed property API from FullStory and pass that through a log event. You can then use the session id to construct the url like the example below.

Example constructing your url to session with your `ORG_ID` and `SESSIONID`: 

https://app.fullstory.com/ui/<ORG_ID>/session/<SESSIONID> 

 

Implementation 

When logging an event such as “add to cart” with GA, you can add a FullStory Session:

iOS:

let sessionURL = FS.currentSessionURL ?? "No Session Found."
let item = “Bananas”

var infoDict =  [String: String]()

infoDict[“itemAdded”] = item
infoDict[“fullstory_sessionURL”] = sessionURL

Analytics.logEvent(AnalyticsEventAddToCart, parameters: infoDict)

Android:

String sessionUrl = FS.getCurrentSessionURL();
String item = `Bananas`;

Map<String, String> infoDict = new HashMap<>();
infoDict.put(`item`, item);
infoDict.put(`fullstory_sessionURL`, sessionUrl);
FirebaseAnalytics.logEvent(ADD_TO_CART, infoDict);

 

Identifying users variables at the same time for both FullStory and Google Analytics: 

By Identifying users at the same time for both GA and FullStory, it can be easier to narrow down sessions as well as cross reference data between our platforms.

Example: (GA on Left & FullStory on the right)

Screen_Shot_2020-07-31_at_10.59.20_AM.pngScreen_Shot_2020-07-31_at_10.58.02_AM.png

 

Use cases

1.Identify the user at Login/ Sign:

You will want to set user variables or Identify a Users with a UUID and their info with FullStory and Google Analytics at the same time so that you can search the same User in FullStory and GA by their UUID or any other info gathered like an email.

2. Reset user info at Logout:

You will want to release the identity of the current user in FullStory and create a new anonymous session, and for GA you will want to clear all analytics data for this app from the device and resets the app instance id.

 

Implementation 

1. Identify the user at Login/ Sign:

iOS:

// User Logs In...
Analytics.setUserID(user.id.uuidString)
Analytics.setUserProperty(user.email, forName: "user_email")
FS.identify(user.id.uuidString, userVars: user.infoDict)

Android:

// User Logs in
Map<String, String> userVars = new HashMap<>();

userVars.put("displayName", "Ada Lovelace");
userVars.put("email", "ada@example.com");

mFirebaseAnalytics.setUserId(user.id);
FS.identify(user.id, userVars);

2. Reset user info at Logout:

iOS:

// User Logs out...
FS.anonymize()
Analytics.resetAnalyticsData()

Android:

// User Logs out
FS.anonymize();
Analytics.resetAnalyticsData();

 

Need to get in touch with us?

The FullStory Team awaits your every question.

Contact us