Shopify (E-Com Platform)

Shopify is integrated using the Web SDK integration. Integration is available for web push, on-site messaging, web personalization and data tracking.

In data tracking, a limited set of data is tracked. 

Get your shop URL

Use the shop URL displayed on the admin page of your Shopify account in the URL bar of the browser. Example shop URL is MY-SHOP-NAME.myshopify.com.

Shopify01.png

Install URL

After you have your shop URL,

Navigate to https://shopify-integration.moengage.com/shopify?shop=MY-SHOP-NAME.myshopify.com and click on the Install unlisted App button.

info

Note

Make sure you replace MY-SHOP-NAME.myshopify.com with the URL you have got from the get your shop URL step.

6d04ae5-moe-prod-test.myshopify.com_admin_oauth_request_grant_client_idd1a6a3103ea9e24dcdb4555e45a24a2dredirect_urihttps3A2F2Fshopify-integration.moengage.com2Fshopify2Fcallbackscopewrite_themes2Cread_themes2Cread_script_tags2Cwrit.png

 

Installation of the app is complete and the following screen is displayed.

Screenshot_2022-05-26_at_2.07.20_PM.png

If you want to track few data and events, listed below automatically, then check the Enable tracking shopify automated events and Fill the following:

  1. For the App ID, navigate to MoEngage Dashboard > Settings > App > General
  2. For Data API Key,
    • Navigate to MoEngage Dashboard > Settings > App > APIs > DATA API Settings
    • Click Generate Key
    • Copy the Data API Key and click on Save Button
  3. Enter the Data Center where you want to direct the data. Contact your account manager or email us at support@moengage.com for information on the appropriate data center for you.
  4. Click on Submit after filling it.

Test environment

In order to send the data to the test environment, please append `_DEBUG` after the App ID

Navigate to Online Store

Go to Shopify Admin and click on "Online Store"

4363cff-1_ed.png

Customize Store Front

Select on "Themes" on left sidebar and click on "Customize"

f6fb9d4-2_ed.png

Use the Code Editor

Go to "Theme Settings" at the bottom left corner and click on "Edit Code"

34ad31a-3_ed.png

Edit the theme

Select the file theme.liquid and add the following piece of code just before the `</head> `tag:. Make sure you replace you replace `YOUR-APP-ID` with the App ID you get on the MoEngage Dashboard.

build.gradle(.kts)
<script type="text/javascript">
 (function(i,s,o,g,r,a,m,n){i.moengage_object=r;t={};q=function(f){return function(){(i.moengage_q=i.moengage_q||[]).push({f:f,a:arguments})}};f=['track_event','add_user_attribute','add_first_name','add_last_name','add_email','add_mobile','add_user_name','add_gender','add_birthday','destroy_session','add_unique_user_id','moe_events','call_web_push','track','location_type_attribute'],h={onsite:["getData"]};for(k in f){t[f[k]]=q(f[k])}a=s.createElement(o);m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m);i.moe=i.moe||function(){n=arguments[0];return t};a.onload=function(){if(n){i[r]=moe(n)}}})(window,document,'script','https://cdn.moengage.com/webpush/moe_webSdk.min.latest.js','Moengage')
  Moengage = moe({
  app_id:'YOUR-APP-ID',
  debug_logs: 0,
  swPath: '/tools/moengage/sw.js'
  });
</script>
  {% include 'moe.liquid' %}

bc3c010-4_ed.png

The integration is complete.

Event and Data Tracking

MoEngage, by default, tracks the following attributes:

Tracking User Attributes

Attributes Description

email,
mobile,
first_name,
last_name,
tags,
currency

These are the attributes that will be tracked on creating a new account on the store

Tracking Events

Event Name Data Attributes Description
Create Checkout
Update Checkout
token,
cart_token,
email,
gateway,
buyer_accepts_marketing,
created_at,
updated_at,
landing_site,
note,
referring_site,
taxes_included,
total_weight,
currency,
completed_at,
closed_at,
user_id,
location_id,
source_identifier,
source_url,
device_id,
phone,
customer_locale,
name,
source,
abandoned_checkout_url,
source_name,
presentment_currency,
total_discounts,
total_line_items_price,
total_price,
total_tax,
subtotal_price,
total_duties,
shipping_address_first_name,
shipping_address_address1,
shipping_address_phone,
shipping_address_city,
shipping_address_zip,
shipping_address_province,
shipping_address_country,
shipping_address_last_name,
shipping_address_address2,
shipping_address_company,
shipping_address_latitude,
shipping_address_longitude,
shipping_address_name,
shipping_address_country_code,
shipping_address_province_code,
customer_id,
customer_email,
customer_accepts_marketing,
customer_created_at,
customer_updated_at,
customer_first_name,
customer_last_name,
customer_orders_count,
customer_state,
customer_total_spent,
customer_last_order_id,
customer_note,
customer_verified_email,
customer_multipass_identifier,
customer_tax_exempt,
customer_phone,
customer_tags,
customer_last_order_name,
customer_currency,
customer_accepts_marketing_updated_at,
customer_marketing_opt_in_level,
customer_admin_graphql_api_id
Same attributes will be tracked on Checkout create and update events
Orders Fulfilled email,
closed_at,
created_at,
updated_at,
number,
note,
token,
gateway,
test,
total_price,
subtotal_price,
total_weight,
total_tax,
taxes_included,
currency,
financial_status,
confirmed,
total_discounts,
total_line_items_price,
cart_token,
buyer_accepts_marketing,
name,
referring_site,
landing_site,
cancelled_at,
cancel_reason,
total_price_usd,
checkout_token,
reference,
user_id,
location_id,
source_identifier,
source_url,
processed_at,
device_id,
phone,
customer_locale,
app_id,
browser_ip,
landing_site_ref,
order_number,
line_item_id,
variant_id,
title,
quantity,
sku,
variant_title,
vendor,
fulfillment_service,
product_id,
requires_shipping,
taxable,
gift_card,
name,
variant_inventory_management,
product_exists,
fulfillable_quantity,
grams,
price,
total_discount,
fulfillment_status,
admin_graphql_api_id
Tracked after the order is marked as fulfilled
Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?