Shopify and RedTrack
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 Shopify platform was engineered for reliability and scale, making enterprise-level technology available to businesses of all sizes.
To integrate Shopify with RedTrack act as follows:
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: Also pay attention that if you don’t add Shipping as an event, conversions which are supposed to be counted as Shipping will be counted as default conversions but marked with a minus. That being said, Total Revenue will count all the conversions, the minus ones as well. Check out the example: Cost of product = $50 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: 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. Once you’ve added your Website, you already have the following scripts generated automatically: ⬇️ 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 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: ⬇️ 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 2 scripts: Universal tracking script and Web events tracking Events.js: Copy the following 2 scripts generated once you've added your Website within step 4: Copy the following 2 scripts: 2) This Web events tracking Events.js script, but make sure to replace the "your.tracking.domain" part with your actual custom tracking domain: 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 Add and set up the following Webhooks: Values to be inserted in this webhook: You can take the URL from the Website form added within step 4: Copy this URL: https://ecomappspf.redtrack.io/custom_webhooks Values to be inserted in this webhook: Take the URL from the Website form added within step 4: Copy this URL: https://ecomappspf.redtrack.io/custom_webhooks Note! Values to be inserted in this webhook: How your webhook will look like once the values are filled in: Values to be inserted in this webhook: ⬇️ 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): Important note for Affiliates only! 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): Important note for Affiliates only! Your 2 scripts are as follows: 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. 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. You are all set! Good luck!
Shipping cost = $10
Purchase Revenue = $60
Total Revenue = $50
Settings on Shopify’s side
Connecting the RedTrack.io account to the Shopify Private APP
<script src="https://your.tracking.domain/events.js"></script>
"Order edit" webhook should be added only for Upsell event tracking.
Copy this Custom checkout tracking script, but remember to replace the "your tracking.domain" part with your actual tracking domain:{% if first_time_accessed && !post_purchase_page_accessed %} <script src="https://your.tracking.domain/order_completed.js?shop={{ shop.permanent_domain }}&orderid={{ order.id }}"></script> {% endif %}
1) Universal tracking script
2) This Upsell Tracking script:
<script> (function() {
var s = document.createElement( 'script' );
s.setAttribute('src', 'https://your.tracking.domain/order_completed.js?shop=<shop_id>.myshopify.com');
document.body.appendChild(s);
})();
</script>