SlideShare a Scribd company logo
1 of 10
Download to read offline
Use Case :

Abandoned
Carts
for eCommerce
1

Abandoned
Carts
Since the early days of e-commerce, abandoned carts have been a problem.
User adds products in his basket and for some reason, he leaves it without
completing the purchase. With mobile commerce, distractions are limitless
and abandoned carts increase in number.
If your platform runs both on web & mobile app, it is more difficult to know
if the purchasing is complete or not. User might have started purchasing in
one platform and completed in the other. Real answer comes from your
backend system. You can make this system talk to Netmera and say
“There is an abandoned cart!” with our rest API. Then, setting an
auto-triggered push notification with related event will do the rest.

Use Case: Abandoned Carts
2
Step1
Create a new application
Create a new application over Netmera web site.

Step2
Add Netmera SDK
Add Netmera SDK into your application. In order to use Netmera features,
you should integrate Netmera SDK (iOS or Android) within your application.
Details about integration are here:
Tutorial : http://cp.netmera.com/admin/tutorial

Use Case: Abandoned Carts
3
Step3
Push Registration
Register your device to Netmera Push Service through SDK. Related
documents are here:
For Android Platform :
http://www.netmera.com/resources/android-guide/push-notification
(Step1-2-3)
For IOS Platform :
http://www.netmera.com/resources/ios-guide-2-0/netmera-push-notification/
(Step1-2-3)

Step4
Identify your customers
You can identify users with Netmera installation ID value. This value is a
unique id generated by Netmera SDK. When user logins to your mobile
application, this ID can be send together with username and password info.
Later it can be stored in your user database. You can get installation ID for
devices using:
For Android Netmera.getInstallationId() method
For iOS [Netmera getInstallationId] method

Use Case: Abandoned Carts
4
Step5
Integrating a custom event
Next step is integrating a custom event to your expiration control algorithm
(or abandoned cart algorithm). Whenever you detect if a customer’s cart is
about to expire (say 2 mins before expiration or 2 min before it falls into
abandoned cart category) in your server side system, you fire a custom
event to Netmera using our REST Event API. Events can be fired using
following sample curl request:

curl -X POST 
-H “X-netmera-api-key: YOUR_API_KEY” 
-H “Content-Type: application/json” 
-d ‘{
“eventType”: “CartIsToExpire”,
“iid”: “INSTALLATION_ID_OF_CUSTOMER”
}
}’ 
https://api.netmera.com/event/1.0/fireEvent

Use Case: Abandoned Carts
5
Step6
Create your rich push
Design and develop an HTML-based content for your rich push notification.

Use Case: Abandoned Carts
6
Step7
Create your rich push
Now, you are ready to send the notification. You can follow rich push
preparation steps in the demo part. You can insert the HTML prepared in
Step 6. After auto-triggered push is set, user will get a notification
whenever they abandon their cart or when the cart is about to expire.

Step8
Ready to send
Now you want customers to be forwarded to “My Cart” page in the mobile
application from rich push notification content. To achieve this, your native
application should be able to communicate with the rich push notification
webview.
In order to communicate with client code, you will create a dummy iframe
with a specific source url when the relevant button is touched on the rich
push notification. Then, your client code will catch the given url, and do
needed process to forward user to mobile application’s cart page.
For iOS platform, one way is to use the UIWebViewDelegate method
**webView:shouldStartLoadWithRequest:navigationType:**,
which allows the native iOS application to intercept loading requests of
webview and decide if the webview should load coming request again.

Use Case: Abandoned Carts
7
Here is a sample implementation for the javascript snippet needed in the
HTML code(‘forwardToAppButton’ is the id property of the button in rich
push html which you wants to track in native application):
$(“#forwardToAppButton”).click(function {
var iframe = document.createElement(“IFRAME”);
iframe.setAttribute(“src”, “myappidentifier-mycart:
“);
document.documentElement.appendChild(iframe);
iframe.parentNode.removeChild(iframe);
iframe = null;
});

And this is the client code which will cover the fake request of the iframe,
and open “MyCart” view controller (You should put the following code into
the **webView:shouldStartLoadWithRequest:navigationType:** method in
NMRichPushViewController.m file):
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:
(NSURLRequest *)request navigationType:
(UIWebViewNavigationType)navigationType
{
//You should NOT remove this line in order to make controller work properly!!
BOOL load = [super webView:webView shouldStartLoadWithRequest:request
navigationType:navigationType];
NSString *prefix = @”myappidentifier-mycart:”;
NSString *urlString = [[request URL] absoluteString];
if([urlString hasPrefix:prefix])
{
// Cart forwarding requested. Write needed code to open controller of my cart
page.
//Sample code:
MyCartViewController *controller = [[MyCartViewController alloc] init];
[self presentViewController:controller animated:YES completion:^{
}];
return NO;
}
return load;
}

Use Case: Abandoned Carts
8
By this way, you provide users to be forwarded to their carts in mobile app
when they press “Go To Cart” button in the rich push notification.
For Android platform, you can call native functions inside the rich push,
in order to do it, you should call handleRichPush() method with an
NetmeraJavascriptInterface object or list of NetmeraJavascriptInterfaces.
While creating netmeraJavascriptInterface objects you should set two
parameters:
An object and a string which is used inside javascript to call native java
functions.
Public methods of the given object can be called inside javascript. For
example you may have a class like:
public class MyJavaScriptInterface {
Context mContext;
MyJavaScriptInterface(Context c) {
mContext = c;
}
@JavascriptInterface
public void openNativeApplication() {
Intent intent = new Intent(PushActivity.this, PaymentActivity.class);
startActivity(intent);
}
}

You can create a NetmeraJavascriptInterface object from this class as
shown below:
MyJavaScriptInterface myJavaScriptInterface =
new MyJavaScriptInterface(getApplicationContext());
NetmeraJavascriptInterface javascriptInterface =
new NetmeraJavascriptInterface( myJavaScriptInterface, “AndroidFunction”);

Use Case: Abandoned Carts
9
And while calling handleRichPush you should give this object as the second
parameter:
NetmeraPushService.handleRichPush(PushActivity.this, javascriptInterface);

Now you can simply call any method of your custom class inside javascript
as follows:
AndroidFunction.yourPublicMethod();

We want to open our native application when the button clicked, so we
place it an approprate place in our rich push.
$(“#forwardToAppButton”).click(function {
AndroidFunction.openNativeApplication();
});

This is an example of how the rich push notification is seen on a real device.
Now, by following these steps you can create abandoned cart campaigns
easily.

Use Case: Abandoned Carts

More Related Content

Similar to Abandoned carts

Self checkout application presentation
Self checkout application presentationSelf checkout application presentation
Self checkout application presentationAshwinBicholiya
 
java and javascript api dev guide
java and javascript api dev guidejava and javascript api dev guide
java and javascript api dev guideZenita Smythe
 
Razorpay Payment Gateway Integration In iOS Swift
Razorpay Payment Gateway Integration In iOS SwiftRazorpay Payment Gateway Integration In iOS Swift
Razorpay Payment Gateway Integration In iOS SwiftInnovationM
 
Paypal Integration For Android Application By LetsNurture
Paypal Integration For Android Application By LetsNurturePaypal Integration For Android Application By LetsNurture
Paypal Integration For Android Application By LetsNurtureKetan Raval
 
Using the Google SafetyNet API for Banking & Finance
Using the Google SafetyNet API for Banking & FinanceUsing the Google SafetyNet API for Banking & Finance
Using the Google SafetyNet API for Banking & FinanceHitesh Sahu
 
Documentation
DocumentationDocumentation
Documentationminhnv85
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19Vivek chan
 
Leture5 exercise onactivities
Leture5 exercise onactivitiesLeture5 exercise onactivities
Leture5 exercise onactivitiesmaamir farooq
 
Lecture exercise on activities
Lecture exercise on activitiesLecture exercise on activities
Lecture exercise on activitiesmaamir farooq
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
Social Gold in-Flash Webinar Jan 2010
Social Gold in-Flash Webinar Jan 2010Social Gold in-Flash Webinar Jan 2010
Social Gold in-Flash Webinar Jan 2010Social Gold
 
Social Gold In-Flash Payments Webinar
Social Gold In-Flash Payments WebinarSocial Gold In-Flash Payments Webinar
Social Gold In-Flash Payments WebinarSocial Gold
 
Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Sunil kumar Mohanty
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Mahmoud Hamed Mahmoud
 
Android Quiz App – Test Your IQ.pdf
Android Quiz App – Test Your IQ.pdfAndroid Quiz App – Test Your IQ.pdf
Android Quiz App – Test Your IQ.pdfSudhanshiBakre1
 
Micro services from scratch - Part 1
Micro services from scratch - Part 1Micro services from scratch - Part 1
Micro services from scratch - Part 1Azrul MADISA
 
The Design of Motion - Creating Movement without Flash - Jesse Hodges, AspDot...
The Design of Motion - Creating Movement without Flash - Jesse Hodges, AspDot...The Design of Motion - Creating Movement without Flash - Jesse Hodges, AspDot...
The Design of Motion - Creating Movement without Flash - Jesse Hodges, AspDot...AspDotNetStorefront
 
Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...naseeb20
 

Similar to Abandoned carts (20)

Self checkout application presentation
Self checkout application presentationSelf checkout application presentation
Self checkout application presentation
 
java and javascript api dev guide
java and javascript api dev guidejava and javascript api dev guide
java and javascript api dev guide
 
Razorpay Payment Gateway Integration In iOS Swift
Razorpay Payment Gateway Integration In iOS SwiftRazorpay Payment Gateway Integration In iOS Swift
Razorpay Payment Gateway Integration In iOS Swift
 
Paypal Integration For Android Application By LetsNurture
Paypal Integration For Android Application By LetsNurturePaypal Integration For Android Application By LetsNurture
Paypal Integration For Android Application By LetsNurture
 
Using the Google SafetyNet API for Banking & Finance
Using the Google SafetyNet API for Banking & FinanceUsing the Google SafetyNet API for Banking & Finance
Using the Google SafetyNet API for Banking & Finance
 
Documentation
DocumentationDocumentation
Documentation
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
 
Leture5 exercise onactivities
Leture5 exercise onactivitiesLeture5 exercise onactivities
Leture5 exercise onactivities
 
Lecture exercise on activities
Lecture exercise on activitiesLecture exercise on activities
Lecture exercise on activities
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Social Gold in-Flash Webinar Jan 2010
Social Gold in-Flash Webinar Jan 2010Social Gold in-Flash Webinar Jan 2010
Social Gold in-Flash Webinar Jan 2010
 
Social Gold In-Flash Payments Webinar
Social Gold In-Flash Payments WebinarSocial Gold In-Flash Payments Webinar
Social Gold In-Flash Payments Webinar
 
Proejct portfolio
Proejct portfolioProejct portfolio
Proejct portfolio
 
Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
Android Quiz App – Test Your IQ.pdf
Android Quiz App – Test Your IQ.pdfAndroid Quiz App – Test Your IQ.pdf
Android Quiz App – Test Your IQ.pdf
 
Micro services from scratch - Part 1
Micro services from scratch - Part 1Micro services from scratch - Part 1
Micro services from scratch - Part 1
 
Razorpay
RazorpayRazorpay
Razorpay
 
The Design of Motion - Creating Movement without Flash - Jesse Hodges, AspDot...
The Design of Motion - Creating Movement without Flash - Jesse Hodges, AspDot...The Design of Motion - Creating Movement without Flash - Jesse Hodges, AspDot...
The Design of Motion - Creating Movement without Flash - Jesse Hodges, AspDot...
 
Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...
 

Recently uploaded

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Abandoned carts

  • 2. 1 Abandoned Carts Since the early days of e-commerce, abandoned carts have been a problem. User adds products in his basket and for some reason, he leaves it without completing the purchase. With mobile commerce, distractions are limitless and abandoned carts increase in number. If your platform runs both on web & mobile app, it is more difficult to know if the purchasing is complete or not. User might have started purchasing in one platform and completed in the other. Real answer comes from your backend system. You can make this system talk to Netmera and say “There is an abandoned cart!” with our rest API. Then, setting an auto-triggered push notification with related event will do the rest. Use Case: Abandoned Carts
  • 3. 2 Step1 Create a new application Create a new application over Netmera web site. Step2 Add Netmera SDK Add Netmera SDK into your application. In order to use Netmera features, you should integrate Netmera SDK (iOS or Android) within your application. Details about integration are here: Tutorial : http://cp.netmera.com/admin/tutorial Use Case: Abandoned Carts
  • 4. 3 Step3 Push Registration Register your device to Netmera Push Service through SDK. Related documents are here: For Android Platform : http://www.netmera.com/resources/android-guide/push-notification (Step1-2-3) For IOS Platform : http://www.netmera.com/resources/ios-guide-2-0/netmera-push-notification/ (Step1-2-3) Step4 Identify your customers You can identify users with Netmera installation ID value. This value is a unique id generated by Netmera SDK. When user logins to your mobile application, this ID can be send together with username and password info. Later it can be stored in your user database. You can get installation ID for devices using: For Android Netmera.getInstallationId() method For iOS [Netmera getInstallationId] method Use Case: Abandoned Carts
  • 5. 4 Step5 Integrating a custom event Next step is integrating a custom event to your expiration control algorithm (or abandoned cart algorithm). Whenever you detect if a customer’s cart is about to expire (say 2 mins before expiration or 2 min before it falls into abandoned cart category) in your server side system, you fire a custom event to Netmera using our REST Event API. Events can be fired using following sample curl request: curl -X POST -H “X-netmera-api-key: YOUR_API_KEY” -H “Content-Type: application/json” -d ‘{ “eventType”: “CartIsToExpire”, “iid”: “INSTALLATION_ID_OF_CUSTOMER” } }’ https://api.netmera.com/event/1.0/fireEvent Use Case: Abandoned Carts
  • 6. 5 Step6 Create your rich push Design and develop an HTML-based content for your rich push notification. Use Case: Abandoned Carts
  • 7. 6 Step7 Create your rich push Now, you are ready to send the notification. You can follow rich push preparation steps in the demo part. You can insert the HTML prepared in Step 6. After auto-triggered push is set, user will get a notification whenever they abandon their cart or when the cart is about to expire. Step8 Ready to send Now you want customers to be forwarded to “My Cart” page in the mobile application from rich push notification content. To achieve this, your native application should be able to communicate with the rich push notification webview. In order to communicate with client code, you will create a dummy iframe with a specific source url when the relevant button is touched on the rich push notification. Then, your client code will catch the given url, and do needed process to forward user to mobile application’s cart page. For iOS platform, one way is to use the UIWebViewDelegate method **webView:shouldStartLoadWithRequest:navigationType:**, which allows the native iOS application to intercept loading requests of webview and decide if the webview should load coming request again. Use Case: Abandoned Carts
  • 8. 7 Here is a sample implementation for the javascript snippet needed in the HTML code(‘forwardToAppButton’ is the id property of the button in rich push html which you wants to track in native application): $(“#forwardToAppButton”).click(function { var iframe = document.createElement(“IFRAME”); iframe.setAttribute(“src”, “myappidentifier-mycart: “); document.documentElement.appendChild(iframe); iframe.parentNode.removeChild(iframe); iframe = null; }); And this is the client code which will cover the fake request of the iframe, and open “MyCart” view controller (You should put the following code into the **webView:shouldStartLoadWithRequest:navigationType:** method in NMRichPushViewController.m file): - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest: (NSURLRequest *)request navigationType: (UIWebViewNavigationType)navigationType { //You should NOT remove this line in order to make controller work properly!! BOOL load = [super webView:webView shouldStartLoadWithRequest:request navigationType:navigationType]; NSString *prefix = @”myappidentifier-mycart:”; NSString *urlString = [[request URL] absoluteString]; if([urlString hasPrefix:prefix]) { // Cart forwarding requested. Write needed code to open controller of my cart page. //Sample code: MyCartViewController *controller = [[MyCartViewController alloc] init]; [self presentViewController:controller animated:YES completion:^{ }]; return NO; } return load; } Use Case: Abandoned Carts
  • 9. 8 By this way, you provide users to be forwarded to their carts in mobile app when they press “Go To Cart” button in the rich push notification. For Android platform, you can call native functions inside the rich push, in order to do it, you should call handleRichPush() method with an NetmeraJavascriptInterface object or list of NetmeraJavascriptInterfaces. While creating netmeraJavascriptInterface objects you should set two parameters: An object and a string which is used inside javascript to call native java functions. Public methods of the given object can be called inside javascript. For example you may have a class like: public class MyJavaScriptInterface { Context mContext; MyJavaScriptInterface(Context c) { mContext = c; } @JavascriptInterface public void openNativeApplication() { Intent intent = new Intent(PushActivity.this, PaymentActivity.class); startActivity(intent); } } You can create a NetmeraJavascriptInterface object from this class as shown below: MyJavaScriptInterface myJavaScriptInterface = new MyJavaScriptInterface(getApplicationContext()); NetmeraJavascriptInterface javascriptInterface = new NetmeraJavascriptInterface( myJavaScriptInterface, “AndroidFunction”); Use Case: Abandoned Carts
  • 10. 9 And while calling handleRichPush you should give this object as the second parameter: NetmeraPushService.handleRichPush(PushActivity.this, javascriptInterface); Now you can simply call any method of your custom class inside javascript as follows: AndroidFunction.yourPublicMethod(); We want to open our native application when the button clicked, so we place it an approprate place in our rich push. $(“#forwardToAppButton”).click(function { AndroidFunction.openNativeApplication(); }); This is an example of how the rich push notification is seen on a real device. Now, by following these steps you can create abandoned cart campaigns easily. Use Case: Abandoned Carts