SaaS Insights now supports multiple users per account! Learn more.

Setting up Google Analytics with your Shopify App and SaaS Insights

ga setup (1)

For trial customers and customers on the Metrics & Analytics plan, in order to use the Analytics tools, Google Analytics integration with SaaS Insights must be setup.

This guide walks through setting up Google Analytics and your Shopify App to collect data on visitors to your Shopify App’s store listing.

Jump To

Google Analytics

If you already have a Google Analytics account, property and / or data stream you will be able to skip some steps. We’ll list all steps for completeness.

1. Create / Log In To Your Google Analytics Account

Go to analytics.google.com and log in with your Google account.

2. Go to Admin panel

Press the cog icon in the bottom left corner to go to the Admin panel.

screenshot of cog

3. Create account

If you are creating a new account from scratch, you can ignore this setup.

Otherwise, click the Create button then select Account.

screenshot of create menu dropdown

4. Enter Account Name

Enter a name for your account. Then click Next.

screenshot of form to enter account name

5. Enter Property Name

Enter a name for the property. Then select the appropriate timezone and currency. Then click Next.

screenshot of form to enter property name

6. Business details

Enter in your business category and size. Then click Next.

screenshot of business detail form

7. Business objectives

Choose the relevant business objectives. Then click Create.

screenshot of business objectives form

8. Google Analytics Terms of Service Agreement

Choose the terms for you location. When ready, accept and press the I Accept button.

9. Collecting Data

We now want to add a data stream where data from Shopify for an application will be stored.

Choose the Web platform.

web collection screenshot

10. Create Web Stream

Enter in your Shopify apps URL and give it a name. Then click Create Stream.

screenshot of create web stream form

11. Measurement ID

Take note of the Measurement ID as that’s the value we need to supply to Shopify via the Partner portal.

screenshot showing measurement id

12. API Secret

From that page we also need to get the API Secret. This can be created by clicking on Measurement Protocol API secret.

screenshot of api secret creation link

13. Create API Secret

You may first need to Review and accept the terms.

screenshot of review terms button

Then, click the Create button.

screenshot of create button

Then give the API Key a nickname like “Shopify App Listing”, then click Create.

screenshot of for allowing a nickname to be assigned to api secret

Now take note of the secret value (aka API Secret) as we’ll need it later.

screenshot showing api secret value

14. Add Custom Definitions

We use custom definitions to provide you even more data like which store was accessing your application.

To do this, firstly click on the cog to go back to the the main admin page.

cog screenshot

Then click Custom Definitions.

Screenshot showing Custom definitions location in Admin

Now click Create custom dimension

Create custom dimension button screenshot for Google Analytics

Enter “shop_id” into both Dimension name and Event parameter fields and then click Save.

Screenshot showing new custom dimension creation form

We now want to create five more custom dimensions.

Repeat the above to create custom dimensions for the below values. Remember the below values must be in both the Dimensions Name and Event parameter fields.

  • event_label
  • event_category
  • api_key
  • surface_type
  • surface_detail

For more information about these custom dimensions, see Shopify’s documentation.

You should now see all four Custom Definitions.

Screenshot showing custom definitions list

If you only have one Shopify App, then you can go to the Shopify Partner Portal steps.

15. Create Measurement IDs, API Secrets and set Custom Definitions for additional apps

Click Next and go to your Accounts Admin page.

We recommend an individual Property be created for each Shopify app.

Click Create and select Property.

Screenshot of create dropdown with account and property enabled.

Then follow the steps as above.

16. Bonus Tip – Finding Measurement ID and API Secret After Property Created

Sometimes you want to go back and find your properties Measurement ID after some time after it’s created.

Ensure the desired account and property is selected in the top bar.

Screenshot of app selection dropdown

To do so, go to the admin Panel and click the cog button in the bottom left corner.

cog screenshot

Then click Data Streams.

Data steams link in Admin settings

Select the the data stream

Semo app link in Data Streams lit

The Measurement ID will then be displayed.

Scrennshot of Measurement ID

For the API Secret click on Measurement Protocol API secrets and copy the Secret value (aka API Secret)

Screenshot of Measurement Protocol API Secrets link

Shopify Partner Portal

We now want to provide the Google Analytics data stream Measurement ID for each app to Shopify.

1. Log into the Shopify Portal

Log in via partners.shopify.com.

2. Open your app

Choose Apps from the left menu.

Apps link in sidebar

Then choose your app.

Individual App link

Then click the Distribution in the left menu.

Distribution sidebar link

Then click the Manage Listing button

3. Enter Google Analytics Information

Then scroll down to the Tracking Information section and enter your Measurement ID and API Secret into the corresponding fields. Then scroll down and click Save & Publish.

Form to enter Google Analytics tracking information

Setup SaaS Insights

Once the above tasks have been completed we’re ready to setup our integration with SaaS Insights.

1. Sign into Google

Go to your SaaS Insights Google Analytics settings page.

Click the Sign In with Google button and select the account you used above to create your Google Analytics account.

Sing into google screenshot

2. Approve Access to SaaS Insights

Be sure that “See and download your Google Analytics data” is checked and then click the Continue button.

Google permissions approval form screenshot

By clicking approve you’re granting us permission to access your Google Analytics data. We’re only requesting the data we need to be able to deliver the service. Nothing more!

3. Setup Google Analytics Linked To Your App

If you only have one Google Analytics account and property setup, we’ll automatically set it up.

Settings page showing app integration with Google Anlaytics

If you have more we’ll need to set them up individually.

You’ll need to setup individually if you see “Not yet configured” fields.

Choose the GA Account and GA Property which match the Shopify App Store URL. Then click Save.

Setting up new app screenshot

Repeat until all apps are setup.

Once all are setup, you can now click on Analytics in the top bar and view your apps analytics data.