E-com

Shopify Private App

Shopify: general overview

Shopify is the leading cloud-based, multi-channel commerce platform. Merchants can use the software to design, set up, and manage their stores across multiple sales channels, including web, mobile, social media, marketplaces, brick-and-mortar locations, and pop-up shops. The platform also provides merchants with a powerful back-office and a single view of their business. The Shopify platform was engineered for reliability and scale, making enterprise-level technology available to businesses of all sizes.

If you’re looking for a tracking tool that will help you gain insight into your e-commerce business, RedTrack is the perfect solution for you. This article will show you how easy it is to integrate your Shopify store with the RedTrack private app.

Settings on the RedTrack’s side

⬇️ 1. Add custom tracking domain

 

Use this guide or this video tutorial to help you add a custom tracking domain.

⬇️ 2. Create custom conversion events

 

2.1 Go to Tools -> Conversion tracking -> Conversion types -> set the events supported by Shopify-> if needed, add types in the event names (you can also apply different duplicate postback modes for each of them on the right)-> press Save:

This is the list of events you are to use, but you can add other events if needed:

  • ViewContent
  • AddToCart
  • InitiateCheckout
  • Purchase
  • Upsell

Go to our Conversion events article for info on events in RedTrack.

⬇️ 3. Create a custom Brand

3.1 Use this guide to help you add a custom Brand

3.2 Once it’s added, if you work with Facebook, and want to send the PII data for better attribution, in the Brand window scroll down to the Additional parameters section to add postback parameters and assign relevant roles to each of them. Once it’s done, press Save:

You are the one to choose the parameters you want to apply for tracking. Here is the full list of supported parameters:

  • eventid 
  • email 
  • phone 
  • lname 
  • fname 
  • zip
  • сontentid 
  • contenttype 
  • сontent 
  • brand

Make sure this data is available on your side. If not, don’t worry, RedTrack will still send as much data to Facebook as possible.

⬇️ 4. Add your Website

Use this article to help you.

Important!

Once you’ve added your Website, you already have the following scripts generated automatically:

  • universal tracking script
  • all the needed tracking scripts for Shopify with short instructions on where to paste them:

 

Settings on Shopify’s side

⬇️ 5. Create a Custom app

5.1 Login to your Shopify store -> go to the Apps section->navigate to the pop-up option Apps and sales channel settings->Develop apps for your store:

   

5.2 In the top right corner press Create an app:

5.3 Type in the name in the App name field -> choose the developer from the App developer drop-down list -> press Create app:

5.4 Under the Overview tab press Configure API scopes:

5.5 In the “Admin API access scopes” window under the “All” tab scroll down to the scopes named Order editing, Orders, Script tags -> tick the boxes next to them:

5.6 Check in the Selected tab if the right values were selected and if so press Save:

5.7 Once the configuration is saved, press the Install app button in the top right corner:

5.8 Once you’ve installed the app, you will be able to reveal your token

Important!

A warning message will pop up informing you that the access token can only be viewed once and will be revealed to you once you press Install:

When you are ready, press Reveal token once and save it for yourself, as you will need to apply it in step 6.3 below:

 

Connecting the RedTrack.io account to the Shopify Private APP

⬇️ 6. Connect RT account to the Shopify Private App

6.1 Get your Shopify shop id

Copy it from the URL – it is yourshopname.myshopify.com

6.2 Go to your RedTrack account -> Tools -> Integrations -> Shopify -> Add Shopify store:

6.3 Add your shop id (step 6.1 ) and token (step 5.8) -> Save:

⬇️ 7. Add the scripts to your Theme files

7.1 On the main menu navigate to the Online Store section -> Themes -> Actions -> Edit code:

7.2 Open the theme.liquid file:

7.3 Copy the following 2 scripts generated once you’ve added your Website (within step 4):

7.4 Paste these two scripts (universal tracking script&Events.js) to the end of the <head> tag:

Important note! If you decide to change the theme, remember to add the scripts to the new theme once again.

⬇️ 8. Create Webhooks

8.1 Click on Settings in the left bottom corner -> choose the option Notifications:

8.2 Scroll down to the section Webhooks and press Create webhook:

8.3 Create webhooks for 2 events (“Checkout creation” and “Order creation“) using the parameters below and press Save:

Values to be inserted in the Checkout creation webhook:

  • Event: Checkout creation;
  • Format: JSON
  • URL: take it from the Website form added within step 4:

  • Webhook API version: 2023-01 (Latest). It is crucially important for you to choose the latest version of Webhook API from the dropdown. Usually the latest Webhook API version is marked with the current year and the word (Latest) at the end:

How your webhook will look like once the values are filled in:

 

Values to be inserted in the Order creation webhook:

  • Event: Order creation;
  • Format: JSON
  • URL: take it from the Website form added within step 4:

  • Webhook API version: 2023-01 (Latest). It is crucially important for you to choose the latest version of Webhook API from the dropdown. Usually the latest Webhook API version is marked with the current year and the word (Latest) at the end:

How your webhook will look like once the values are filled in:

⬇️ 9. Add additional scripts

If you use other checkout options besides standard Shopify checkout, add special additional scripts to your Order status page and Post-purchase page in case you use upsell apps. Without these scripts you may face cost discrepancies. 

To add the scripts act as follows:

9.1 go to Settings-> navigate to the Checkout and accounts section:

 

9.2 scroll down to the end of the page and insert additional scripts to the following sections:

1. Copy the script from the Website form (added within step 4):

2. Paste this script to the section Order status page-> field Additional scripts:

Note!

You add the scripts to the Post-purchase page in the Additional scripts in case you use upsell apps.

1. Copy 2 scripts (Universal tracking srcipt & Upsell Tracking) from the Website form (added within step 4):

2. Paste these scripts to the section Post-purchase page-> field Additional scripts:

3. In the Upsell Tracking script replace the part with your store id, meaning, in the script shop=yourstore.myshopify.com):

10. (optional) For additional setup within the case where the landing page (aka website) domain and the Shopify shop domain are different domains, click here.

Important!

In case you changed your Shopify store domain or/and custom tracking domain, you must change the domains within your Shopify↔RedTrack integration.

Expand to see where the domains should be replaced

When you change the domain name of your Shopify store, remember to do the following:

 

On the RedTrack side:

 

1. Replace the old Offer URL added within step 1.2 with a new one:

 

2. If you work with Facebook, then you should also replace the old Default event URL with a new one (Web-sites-> edit your Offer-> scroll down to the FB part) and make sure it's verified on the FB side:

 

On the Shopify side:

 

3. Replace manually old cookie domain with the new one in the universal tracking script added to theme liquid step 8.3:

 

4. Replace manually old cookie domain with the new one in the universal tracking script added to the Post-purchase page within step 10.2:

When you change the name of the custom tracking domain, do the following:

 

1. Replace the outdated custom tracking domain with an updated one in the universal tracking script and Events.js script added to theme liquid within step 8.3:

 

2. Replace the outdated custom tracking domain with a valid custom tracking domain in the additional scripts added within step 10.2 (Order status page and Post-purchase page scripts):

⬇️ 11. Create tracking Campaigns in RedTrack

Once you’ve added your Website within step 4, a default Campaign for the unattributed traffic was automatically created for you. Your next step is to consider the following tracking scenarios:

Scenario 1: If you only need unattributed (aka organic) traffic, then this Campaign is enough for you and you don’t have to create any more Campaigns manually.

Scenario 2: If in addition to the unattributed traffic you also use several paid Traffic channels (like Facebook or Google or something else) you’ll need to add these Traffic channels first and then create a Campaign for each added channel. Thus, you will have 1 Campaign for the unattributed traffic (created automatically within step 4) and another (or more in case of several Traffic channels) for the paid traffic.

Workflow for Scenario 2:

1. Add the needed Traffic channel.

2. Use this guide to help you launch your Campaign for the paid Traffic channel.

Tip: Your online shop will act as an Offer in most cases, so your Campaigns will have only this Offer in the Funnel.

 

Important notes:

  • If you add some orders to your Shopify store manually and want them to be displayed in RedTrack, please turn to support@redtrack.io for additional assistance.
  • If you need a video tutorial on RedTrack↔Shopify integration go to our RT Youtube channel.

 

You are all set! Good luck!

Related Articles