Shopify Integration

1. Get your shop URL

Find your shop url in the url bar of the browser when are on the admin page of your Shopify account. The shop URL looks something like MY-SHOP-NAME.myshopify.com

2. Go to install URL

Once you've obtained your shop URL, proceed to https://shopify-integration.moengage.com/shopify?shop=MY-SHOP-NAME.myshopify.com and click on Install unlisted App button.

🚧

Make sure you replace MY-SHOP-NAME.myshopify.com with the url you obtained in step 1.

It will install the app and take you to this screen:

If you want the automated shopify events to be tracked (listed here) , then please check the checkbox and fill this form:

  1. Get the App ID from Moengage Dashboard > Settings > App > General
  2. For API Secret Key,
  • Navigate to Moengage Dashboard > Settings > App > APIs > DATA API Settings
  • Click Generate Key
  • Copy the Data API Key and click on Save Button (Important)
  1. Data Center if you want to redirect the to other regions. Please contact Moengage support team for more details on this.

Click on Submit button after filling it.

Unchecking the checkbox of Enable tracking shopify automated events: will disable the automated shopify events to be tracked by moengage.

3. Go to Shopify Admin and click on "Online Store"

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

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

6. 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 MoEngage Dashboard.

<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' %}

Thats all required for the Integration.

Event and Data tracking

By default, Moengage will track these data (only if email address is available):

Event Name

Data Attributes

Description

email,
mobile,
first_name,
last_name,
tags,
currency

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

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

It will be tracked once the order is marked as fulfilled