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.
Sending a FullStory URL of a session with GA events
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.
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`:
When logging an event such as “add to cart” with GA, you can add a FullStory Session:
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)
String sessionUrl = FS.getCurrentSessionURL();
String item = `Bananas`;
Map<String, String> infoDict = new HashMap<>();
Identifying users variables at the same time for both FullStory and GA
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)
- Ability to identify a user at login:
You want to set user variables or identify users with a UUID and their variables 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 their user variables (eg. a user's email).
- Reset to an anonymous user upon logout:
You want to release the identity of the current user in FullStory and create a new anonymous session, and for GA you want to clear all analytics data for this app from the device and resets the app instance id.
Identifying a user at login
// User Logs In...
Analytics.setUserProperty(user.email, forName: "user_email")
FS.identify(user.id.uuidString, userVars: user.infoDict)
// User Logs in
Map<String, String> userVars = new HashMap<>();
userVars.put("displayName", "Ada Lovelace");
Reset a user upon logout
// User Logs out...
// User Logs out