Appbrew resource center
  • Overview
  • Scope of support
  • Roadmap (Q2 2024)
  • Setup
    • App listing
      • Create a Google Play developer account
      • Share access to Play Console
      • Reset Android signing keys on the Play Store
      • Create an Apple developer account
      • Share access to Apple developer account
  • Manage
    • Orders
    • Products
      • Enable Products for Appbrew Sales channel
    • Customers
      • Customer login
      • Enable multipass login on the Shopify Store
    • Store policies
    • Shipping and delivery
      • Estimated Delivery Date
    • Checkout
    • Integrations
  • Merchandising
    • Overview
    • Themes
    • Design blocks
    • Custom page
    • Guide for image dimensions
    • App web-view
      • Control web elements in app webview
  • Growth
    • Discounts
      • Create app-only coupon code
      • Create app-only bulk discounts
    • Marketing
      • Segmented push notifications using Firebase
      • Enable Safari smart banner
      • Create dynamic link using Firebase
    • Analytics
      • Integrations
        • Google Analytics
          • Create a Firebase account
          • Configure GA property linked to the app
          • Tracked events
          • Link Google Analytics to Google Ads
        • Facebook Ads
          • Setup a Facebook developer app
          • Tracked events
          • Setup event tracking for Ads
        • Clevertap
        • Moengage
        • Contlo
        • Klaviyo
        • Webengage
        • Netcore
        • AppsFlyer
  • Migrating to Appbrew
  • Setup purchase pixel
Powered by GitBook
On this page

Was this helpful?

Setup purchase pixel

To track purchase events in the app, please ensure the below pixel is Added to your Shopify.

Steps:

  1. Navigate to your Shopify Admin

  2. Go to Shopify Settings

  3. Go to 'Customer Events'

  4. Click on Create

  5. Name the pixel 'Appbrew'

  6. Place the following code in the pixel

function sendEvent (event, payload) {
  if(window.ReactNativeWebView) {
    window.ReactNativeWebView.postMessage(JSON.stringify({
    action: "SEND_EVENT",
    payload: {
      event,
      payload,
      source: "web-pixel"
    }
  }))
  } else {
    window.parent.postMessage({
      source: "web-pixel",
      event,
      payload
    }, window.location.origin)
  }
}
console.log("pixel", window)
analytics.subscribe('all_events', (event) => {
  console.log(event.name, event.data.checkout)
  sendEvent(event.name, event.data.checkout)
});

  1. Click on 'Save'

  2. Click on 'Connect'

You are all set!

PreviousMigrating to Appbrew

Last updated 3 months ago

Was this helpful?