Integrating GOAFFPRO with mobile apps - anujtenani/goaffpro GitHub Wiki
- Set up DYNAMIC LINKS/DEEP links
- Integrate GOAFFPRO tracking
This is a standard practice, where if a user clicks on your store's URL (eg. https://amazon.com), then your store's mobile app opens up on the phone. eg. If you open amazon.com and have the Amazon's mobile app installed on your phone, your phone will either open the app automatically OR give you option to open the link in Amazon APP or the Browser
Though setting up of Dynamic links is out of the scope of this guide. Some general instructions can be found below
To enable deep links in your android app, you can follow the guide below
https://developer.android.com/training/app-links/deep-linking#adding-filters
https://firebase.google.com/docs/dynamic-links/android/
In your AndroidManifest.xml file, for you main activity, set the intent filter to open the app
Note: You will also need to host a assetlinks.json file on your website to verify the identity
https://developer.android.com/training/app-links/verify-site-associations#web-assoc
You can follow the guides below
https://reactnative.dev/docs/linking#built-in-url-schemes
Integrate on mobile apps build with REACT NATIVE
The GOAFFPRO's react native SDK simplifies the integration, by providing Step-by-step instructions. See here https://www.npmjs.com/package/react-native-goaffpro
Though at this stage, we don't have native SDK, but the integration can be easily built using the goaffpro API
-
User clicks on https://store.com/?ref=tom Note: here the referral code is "tom"
-
The phone opens the store.com's MOBILE APP
-
The mobile app then looks at the opening "intent". The app sees the intent URL was https://store.com/?ref=tom and extracts the ref query parameter value from the URL = tom. The app then stores the value in mobile phone storage/sqlitedatabase etc. for later use
From this point, the mobile app vendor can take any one of the following actions
a) When the user completes the checkout, adds "tom" as an ORDER TAG (via the Shopify's ORDERS API) b) When the user completes the checkout, add "tom" as a NOTE_ATTRIBUTE (with name = ref, value = tom) (via the Shopify's ORDERS API) c) Pass the order data via HTTPS call to API https://api.goaffpro.com/v1/sdk/track/conversion endpoint. (https://api.goaffpro.com/docs/admin/#/sdk/post_sdk_track_conversion)
That's it. The integration is now complete