Setting up Firebase / Google Analytics

Shopgate supports Google Analytics for Firebase in its mobile apps.

 

logo-standard-1

Important: Firebase tracking only works after a successful app update. For app updates you need your own developer account with Apple and Google. 
Please inform us via email after setup so that we can initiate an app update.

With the configuration of Google Analytics for Firebase, Shopgate will also use Firebase Cloud Messaging to send pushes on Android for your store. This change only affects the infrastructure - nothing will change for you in the Shopgate merchant area.

Step 1: Create a project in Firebase Console

Recommended: Firebase for Mobile Apps is perfectly complemented with Google Tag Manager.

1. Log into your Firebase Project Console: Firebase

2. Click on “Create a project”

3. Click “Continue” after choosing a project name, the additional setup of Google Analytics is preset. To analyze your mobile app, we recommend setting up Google Analytics for Firebase. You can do that in this step, or do it later at any time. Deactivate the setting (bottom left) for later setup.

Bildschirmfoto_2019-09-30_um_15.22.02

4. Click "Continue."

5. Select “Default Account for Firebase” or create an account for Google Analytics and click “Create project.” After your project has been created, click “Continue.”

After you have set up your Firebase project, you will be redirected to the homepage of your Firebase console, and you can now create your iOS and Android apps in succession.

In this process, Firebase asks for your Android package name and the iOS Bundle Identifier (you do not need to specify your app nickname and App Store ID). These can be found in your Shopgate merchant admin: "Settings" => "Tracking Tools" => "Show App Information."

firebase-app-info-shopgate

6. Click on the icons to add your apps to your project.

app_icons

7. Copy and paste in the information and click "Register app." Download the current configuration file (one click on the blue button). Shopgate has already done the next steps for you (setup SDK, etc.) and you can always click "Next" until the process is finished. This process must be done for iOS and Android separately. At the end of the process, click “Continue to console” to get back to the homepage – click on "Add app" and start the process again with the second app.

You should now have two files saved: googleService-Info.plist from your iOS project and google-services.json from your Android project.

8. Navigate to "Project Settings" => "Cloud Messaging." 

Bildschirmfoto_2019-09-30_um_15.22.46

9. Click on the three dot menu and click on "Manage API in Google Cloud Console."

server_key

10. Click on "ENABLE."

mceclip0-2

11. Close out the Google Cloud Console page and refresh your Firebase Console page, you should now see the server key. Copy the server key. You'll need it to configure the Shopgate setup, so your Android users can continue to receive push messages. 

mceclip1

Step 1 is done! You successfully created your Firebase Project!

Step 2: Connect Firebase project at Shopgate

  1. Log into your Shopgate Admin 
  2. Go to "Settings" => "Tracking Tools."
  3. Insert the server key that you copied from Firebase into the field "FCM server key."
  4. Upload the "google-services.json" file in the Android configuration
  5. Upload the "GoogleService-Info.plist" file in the iOS configuration
  6. Choose how you wish to track your revenue with Firebase. This setting should be identical to your shop settings. If you display gross prices but select "net" then net prices are tracked to Firebase (if available in the Shopgate system).

Step 3: Request an app update

After you have completed the above steps, email us at support@shopgate.com to request an app update. Your Shopgate App manager will re-compile your app and submit it to the App Store for an update. It will take 1 to 3 business days for your app to be updated in the App Store.

As soon as the next app update is available in the app stores, you will see the tracking data in Firebase and the connected Google Analytics account.

Step 4: Invite Shopgate as "Editor"

Please invite firebase@shopgate.com as a user to your Firebase account.

Further information:

 

FAQ  - Why don't I see screen_view events but cryptic names instead?

The Shopgate App is a hybrid app. In order to be able to always publish the latest content quickly and without a lengthy App Store Update process, the presentation layer of your App is served via WebViews. Firebase SDK, unfortunately, doesn't allow WebViews to trigger the reserved event "screen_view" and therefore we can't use this event to track the presentation layer of your app.

So that you can track your shopper's journey and create funnels, we have implemented a custom solution to replace screen_views. Simply use the custom event sg_view_page, which is sent with each screen change of the user.