Enhancement of E-commerce Service by Designing Last Mile Delivery Platform

The revolution of technology and the rapid evolution of the digital world had a significant effect on the development and expansion of e-commerce. Last mile delivery, for which different app-based delivery services have recently emerged, is a new area of research that is not thoroughly addressed. Delivery service is one of the supporting platforms of e-commerce. One of the delivery issues is that many customers experience difficulties in communicating and coordinating with the logistics companies responsible for the delivery service. This challenge is emphasized in this study which introduces a new system to facilitate communication and coordination between customers and logistics companies by using one identity and one interface. This paper is a programming-based study, as the proposed system evaluates a website to serve logistics companies as well as designs an application (app) to serve the customers of logistics companies. Swift, a powerful open-source and object-oriented programming language, and the mark-up language (HTML) were used to build the last mile delivery system. In addition, Firebase, a cloud-hosted real-time database built on Google infrastructure, were used to develop the system. By increasing the level of customer satisfaction and reducing delivery failure rates, this system will eventually increase the prosperity of e-commerce.


Introduction
The Internet has become an integral part of our daily lives today, affecting most aspects of our lives. As people are extremely busy with their businesses, going to the bank to perform transactions or to stores and supermarkets to periodically buy essential needs is difficult and time consuming. Therefore, e-commerce is a great revolution that helps people save time and makes their lives more comfortable, providing them with more and wider options as well as 24-hour availability. It also offers traders and business owners opportunities that enable them to expand globally without incurring the considerable costs involved in renting or building stores or hiring a large number of workers in every region or country. Today, wherever you are, you can buy everything you need from anywhere on the world map without having to travel. At the current time, e-commerce is continuing to expand and evolve in various fields: according to [1], the estimated global e-commerce retail sales will rise from $2.29 trillion in 2017 to $4.48 trillion by the end of 2021. Despite the vast expansion of e-commerce, the great success it has achieved, and the Support services: e-commerce needs additional support services, such as delivery and payment services. Business partnerships: cooperation, partnerships, and exchanges with other companies.
Mobile commerce (M-commerce) is defined as using a mobile device (such as cellular phones, laptops, etc.) and wireless networks to perform e-commerce activities [13][14][15]. It outperforms e-commerce in many features, with the most significant feature being "user mobility" [16]. This new service is offered to current users to conduct e-commerce activities anywhere, and at any time and is also used to attract new users [2]. Online shopping is a type of e-commerce and refers to buying goods or services from sellers or companies online [17]. Online shopping is overcoming traditional shopping due to the proliferation of smart and technical devices. In online shopping, when searching for a particular product or service, thousands of results appear from different traders and factories at different prices and characteristics. With a single click, a shopper can buy what they want without needing to go out and line up in queues to buy it [17,18]. Most e-tailers deliver products to customers via third-party logistics companies. Carriers can be private logistics companies such as FedEx, DHL, UPS, or postal systems within the country. Delivery may take several days or could be overnight. Delivery processes may be regular or on demand. Goods are delivered in two ways, either in a physical format or digitized and delivered electronically, for example, books, publications, etc. [2]. Last Mile phase is the phase in which the goods are delivered to the final customer. As previously mentioned, e-commerce players and logistics companies consider the last mile delivery services as the fundamental differentiator between them and their competitors [5]. The company, DHL, reported that the last mile phase is the least predictable among all phases [19]. In the logistics chain, it is considered the most expensive phase, comprising nearly 50% of the total cost of the entire delivery process [5]. Due to unsuccessful deliveries, unattended deliveries, or delivery to rural areas, logistics companies incur huge costs. Deliveries may, in fact, be more profitable in urban environments due to the high population density in a limited geographical area [20]. Location-based services (LBSs) are applications installed on a mobile device that can determine the user's location by obtaining his/her location information via the global positioning system (GPS) or via a wireless local area network (WLAN) to deliver relevant content [21]. Identity is "a representation of an entity in a specific application domain" [22]. Entities in the real world are people or organizations, and no single identity can be associated with more than one entity. Within a single domain, an individual may have more than one identity or may have no identity at all. Internet networks provide many services and resources, often needing to know the identities of users and to control what services they can use and what resources they can access. Identity management comprises two main parts: the initial registration phase in which unique identifiers and credentials are issued for users, while the second phase is the authentication of users who, based on their identities, are given access to services and resources [22]. The models mentioned below are two of the traditional user identity management models.
Isolated User Identity Model: to access and use different online services, the user receives a unique identifier for each service provider. With the growth of online services, this model may make the users' experience extremely negative as it forces them to memorize multiple passwords [22]. Federated User Identity Model: this model aims to fix the inefficiencies in the isolated user identity model. "Identity federation can be defined as the set of agreements, standards and technologies that enable a group of service providers to recognize user identifiers and entitlements from other service providers within a federated domain" [22].

Related Work
A study conducted by Mangiaracina et al. [23] stated that the last mile delivery phase has an impact on the level of service, costs, and delivery success. Deliveries not completed due to the absence of customers negatively impact on logistics companies and increase their costs as they need to reschedule these deliveries. It has proposed an innovative solution to reduce failed deliveries, which can be done by placing internet of things (IoT) devices, such as smart home speakers, in the customer's house to detect the customer's presence. These devices will generate customer presence profiles to be integrated with vehicle routing problem (VRP) (which traditionally aims at reducing distances traveled) to group customers based on probability of customer's presence at home, then will define the shortest path to take for each of these groups. This method will help to decrease traveled distances as well as decreasing failed deliveries. When this innovative method was applied in Milan, it proved to be more effective in reducing failed deliveries than the traditional method (VRP) that was based on reducing the distances traveled but did not take into account the probability of the customer's presence at home.
India is known for its huge population, traffic congestion, and difficulties in mobility. As a result, many people avoid going to the shops and prefer shopping online; however, electronic customers and logistics companies face many problems. Issues in home delivery were examined in a study conducted through a survey sent to 220 Indian respondents. In total, 85% of respondents mentioned that they had used home delivery services in the previous three months, 90% of them said that delivery concerns significantly affect their decision to buy [3]. According to the respondents' answers, the most important reason driving them to use home delivery services was the ease and comfort of shopping from home. Other reasons included the cost of products, avoiding the cost of traveling to the store, etc. The most important reasons for avoiding the use of home delivery services was the difficulty of returning the item, followed by the high cost of delivery. Another important reason was that no one would be at home when the parcel was delivered. Respondents suggested offering a "station-to-station service." This service could be provided by equipping houses, buildings, and workplaces with safe boxes where parcels could be placed regardless of whether the customer was present or busy at that time. That study recommended that logistics companies should send an SMS message to the customer two or three hours before delivery to help solve the "not-at-home problem." It also recommended establishing pick-up points where parcels could be placed to allow customers to collect their parcels whenever they wanted [3].
Another study was conducted to explore the issues and problems faced by the delivery staff in India [24]. Data were collected from 50 employees in the delivery sector through interviews. Their answers indicated that they faced multiple challenges during the delivery process. Challenges included: dealing with the personalities of different customers with some, at times, behaving badly; customers who, instead of communicating with customer service, would be angry with the delivery employee if they found a fault in their parcels, such as manufacturing line errors or billing problems; customers who asked them to wait longer at the door, leading to delays in subsequent deliveries of parcels; difficulty in locating the customer as the address provided by the customer was inaccurate or incomplete; and needing to deliver a parcel more than once due to previous failed delivery attempts. In cases of cash on delivery, customers would delay payments if they did not have the exact amount of money, leading to more delays in delivering the next parcels [24].
In their study, Ghajargar et al. [25] explored customer feedback about four innovative delivery services. Companies provided the first service, automated pack stations (APSs), by identifying specific places, usually public places, where locker boxes would be installed in which customers' parcels would be placed. Customers would pick up their parcels by using an order reference code. The second service was one in which companies would select a group of stores where parcels would be placed, and customers would pick up their parcels from these stores. The third service was called crowd-delivery which was a new type of mobile phone application that allowed citizens to deliver parcels to customers. The fourth service involved logistics companies improving their systems by adding tracking services using small sensors placed in the parcels. As a result, customers could see the locations through which their parcel had passed and the parcel's exact location in real time. In the above study, a questionnaire was published online and answered by 562 respondents. Their answers indicated that the cost of products was the most powerful factor driving them to shop online, while lack of trust was the strongest factor for avoiding online shopping. Other important factors that characterized a good delivery service were service quality and the possibility of choosing the delivery time and location. As mentioned by respondents, automated pack stations (APSs) and crowd-delivery were the most flexible services in terms of choosing the delivery time and location. The tracking service was viewed as the most reliable service, while the most simple and user-friendly service was delivery to pick-up points [25].
Companies engaged in e-commerce have found that cash-on-delivery and delivery services are the most critical challenges that they face [26]. In this study [26] conducted on e-commerce companies, the aim was to identify the factors that caused lost revenue in last mile delivery, thus reducing profitability. Focus group interviews were conducted with industry leaders and customers to collect delivery service outcomes. Companies lose a huge amount of money every day as most employees who work in delivering/collecting goods and parcels to/from the end-customer are not qualified nor are they sufficiently trained and they are not efficient in their work. When this is combined with the fact that most customers prefer to pay cash-on-delivery, any problem with delivery or non-delivery results in extremely large losses for companies [26]. The study found that many problems could be solved if delivery staff communicated with the customer before attempting to deliver the parcel to ascertain the address and whether the customer would be present. Moreover, having alternate recipient details in case of the failure of delivery to the first address might reduce these problems. Companies engaged in e-commerce also need to train and qualify delivery staff. In addition, deploying and analyzing delivery and communication analytics would provide clear visibility about what needs to be improved [26].
One of the most important factors affecting customer satisfaction is reducing delivery time [27]. Delivery time and cost vary from one e-tailer to the next, with e-tailers that offer flexible delivery options attracting a large segment of customers. In an attempt to identify the factors that determine customer satisfaction with e-tailers, a survey was conducted targeting people who have shopped online at least once. Respondents were asked to answer questions concerning their preferred e-tailer. A total of 129 responses were received. The results revealed that overall customer satisfaction towards an e-tailer increases 1.95 times when they were satisfied with the delivery time. Information and product details on the website increased customer satisfaction by 1.8 times towards an e-tailer [27].
Online shoppers are often asked about their delivery option, whether would prefer home delivery or to pick up the parcel from their nearest store [28]. Miquel-Romero et al. [28] explored the influence of customers' motivation on the choice of the delivery method. They conducted a structured questionnaire targeted at multichannel shoppers living in Spain. A total of 702 responses were received. The results revealed that customers who shopping for pleasure were more likely to choose click-and-collect. In contrast, customers who shopped online for convenience tended to choose home delivery. In addition, immediate gratification and delivery risk perceptions had no effect on the choice of the delivery method [28].

Perception of Users
In the current study, a questionnaire survey was conducted to explore the delivery problems faced by customers. Many customers reported the problem of delivery at times that did not suit them or the difficulty in communicating and coordinating with logistics companies. On the other hand, the most significant problem reported by logistics companies was delivery failure due to customers either not being present at the address or providing inaccurate information when ordering online.

Data Collection
Data collection is an essential step in building an effective system, with a web-based questionnaire created using Google Forms to collect the data. The questionnaire comprised a variety of questions to determine the kinds of problems that customers faced with logistics companies and to identify their preferences. The questionnaire was published on Twitter, a social networking application, with 558 responses received.

Data Analysis
After data collection, the next phase was data analysis. The analysis results revealed that most respondents were aged between 18 and 30, with students making up the largest proportion, followed by employees and then "others" (see Tab. 1). The following conclusions were drawn: A clear majority of respondents (97.5%) had previously purchased online, with 68.8% shopping online once a month, while 14.5% shopped online twice a month. The main motivation driving customers to choose online shopping was that it was more time saving than traditional shopping, followed by the points that online shopping provided more options and that delivery services were needed. Another motivation was the availability of goods at excellent prices. Most online shoppers (84.2%) reported that delivery options had a significant influence on their online shopping decisions. In addition, 90.8% believed that delivery options had an impact on their preference of one e-store over others when searching for a particular item. In assessing online shoppers' level of satisfaction with the quality of services provided by logistics companies, 65.2% believed that the level of service provided was extremely dissatisfactory to average, while 34.8% believed that it was satisfactory to extremely satisfactory. Online shoppers reported facing many problems when dealing with logistics companies, with these classified into six major problems. The most notable problem was the delay and failure to meet delivery times, followed by problems related to the delivery location. Many were upset about their parcels not being delivered to the right or the desired location, in addition to repeatedly having to provide the location to these companies every time they shopped online. They also reported difficulties with describing the location to companies that did not use the global positioning system (GPS). The third problem related to prices, such as high prices and the existence of hidden costs. The fourth problem was lost parcels and damage to parcels. The fifth problem was delivery timing. Many stated that they were not pleased with being unable to set a specific time for delivery requiring them to waste too much time or having to reschedule their commitments due to sudden or inappropriate delivery times. The sixth and final problem was poor communication with logistics companies. Many faced difficulties when trying to communicate with these companies to coordinate deliveries, with some complaining that these companies did not communicate with them regarding their parcels. On the other hand, others complained about the frequent company contacts about their information. In total, 84.9% of online shoppers surveyed confirmed that facilitating communication with logistics companies and providing customers with the ability to choose delivery preferences, such as setting the time and location, would further improve and upgrade their delivery services. Online shoppers suggested several ways to improve and upgrade logistics companies' services. These included meeting delivery times; enabling the customer to choose the appropriate location and time of delivery; facilitating communication between the two parties; and reducing delivery costs. Other ways suggested were providing a parcel tracking service and disclosing all delivery costs that would be incurred by the customer upon delivery, plus providing multiple payment options and activating parcel consolidation services. Additional suggestions included increasing the number of logistics company branches in each region and effective training of their employees.

Proposed Framework
In the light of previous studies, related work, and users' perceptions, this study sought to find a solution to facilitate the communication and coordination processes between logistics companies and their customers. This inspired an idea (derived from the federated user identity model) that provided a solution to the problem of having multiple identities and having to memorize many passwords for different service providers. When the customer registers in the system, the customer is given a single digital identity through which all logistics companies can recognize that customer. When logistics companies receive a parcel containing the customer's digital identity number, they will add the parcel's data to the system's database, showing this to the customer. The system allows customers to set the appropriate delivery preferences, such as determining the date, time, and location, for example, Sunday to Tuesday from 8 am to 11 am with the delivery location set at their office, and from 5 pm to 9 pm with the delivery location set at their home. Customers can set these preferences permanently for all parcels, or specify a date, time, and location for each parcel. The system will share the customer's delivery preferences for each parcel with the logistics company responsible for delivering that parcel. If the customer allows the system to access his/her current location, on the day before delivering the parcel, the system will calculate the distance between the customer's current location and the registered location of that parcel. If the distance is greater than 85 km, a notification will be sent to the customer who will be asked if he/she wants to change the delivery location to the current location, or to leave the delivery location unchanged. If any updates are made, they will be shared with the logistics company. The framework of the proposed system is shown in Fig. 1.

Type of Study
This study is a programming-based project, as the proposed system requires a website to be built that serves logistics companies as well as building an application (app) that serves the customers of logistics companies. Another essential element in the project is building a database that links the website with the application (app). Swift, a powerful open-source and object-oriented programming language, is used to build the app [29]. This adds modern features to make programming easier, more flexible, and more fun. In Swift, complex ideas can be expressed clearly and concisely, so the code is not only easy to write but is also easy to read and maintain [30].
To build the website, the mark-up language, HTML, is used to identify the content of the web page documents. In addition, CSS templates are used to describe how the content of the web page should be rendered. These templates control fonts, colors, background images, etc. JavaScript, the language used to make interactive and responsive web pages, is also utilized [31].
Firebase, a cloud-hosted real-time database built on Google infrastructure, is used to develop the system. The great feature of Firebase, which makes it suitable for the proposed idea, is that all stakeholders can access one database at one time and automatically receive updates with the newest data in real time [32].

System Design
A data flow diagram (DFD) is a common form of process model that represents the flow of data through the processes of a system [33]. The DFD of the proposed system is illustrated in Fig. 2 and described below: Process 1.0: This process registers a new customer or updates a customer's data in the system database.
Process 2.0: When parcel information is entered into the system, this process checks whether the owner of the parcel has registered in the system and, accordingly, assigns the parcel to the customer. Process 3.0: On the day before delivery, this process checks the customer's presence by comparing the stored location with the customer's current location. If the distance is greater than 85 km, a notification will be sent to the customer. Process 5.0: This process specifies the information (customer's delivery preferences for each parcel) to be shown for each company. This specification will depend on which company is responsible for delivering that parcel to the customer.

Implementation and Testing
The most important aspect that gives a project its value is its implementation in the real world and the testing and evaluation of its outputs. The implementation of this project, a system named "My Parcel,", comprises two portions that have been completed. The first portion, serving the customers of logistics companies, is an iOS application. The second portion, serving logistics companies, is a website. The working mechanism and the system's methods are explained below, with the tests applied to this system then presented.

Implementation
This section explains the working mechanism and the methods for using the app by customers and using the website by logistics companies.
Initially, the customer opens the app and the splash screen is displayed. The customer will then be automatically directed to the sign in screen, as presented in Fig. 3. Through this page, the user can log in, register, or reset the password.
When the customer signs in or when a new customer completes the registration, he/she will be redirected to the home screen of the app (see Fig. 4). The home screen contains a list of the customer's parcels. Each parcel is represented by the parcel's tracking number and an image representing the logo of the logistics company responsible for delivering that parcel. A menu icon appears at the top right corner of the screen: clicking on this icon will display a window, as shown in Fig. 5.
The contact us screen allows users of the app to send their suggestions and complaints to the application developers. To start adding preferences, the customer must go to the profile screen by clicking on "Profile" in the menu. The profile screen, shown in Fig. 6, contains the customer's information. On this screen, the user can change his/her personal information and password or delete his/her account. A list of the delivery preferences added by the customer is shown at the bottom of the profile screen. Initially, the list will be empty: after clicking on the plus icon, the customer will be redirected to the delivery preferences screen, as shown in Fig. 7. On this screen, the customer can choose his/her appropriate preferences, for instance, setting the appropriate period of time, delivery day, and location. After saving these preferences, they will appear in the preferences list on the profile screen, as shown in Fig. 8. These preferences are adjustable and removable. More than one preference can certainly be added. Logistics companies will initially be shown the sign in page (see Fig. 9). When a company using the system signs in, it will be redirected to the main page of the website, as shown in Fig. 10.
On this page, the company can add its customers' parcels through a Register a New Parcel box. In addition, it can see its customers' information and preferences in the table at the bottom of the page. If the parcel registration process has been completed successfully, the system will examine the customer's default preferences, and select the preference that best suits the delivery date estimated by the logistics company. For example, suppose that a particular customer has added two preferences, the first preference being for Sunday, while the second preference is for Friday and Saturday. If the company registers a parcel with an estimated delivery date that corresponds to Sunday, the system will choose the preferences related to Sunday and link these preferences to this parcel, sharing them with the company (see Fig. 11).
In another scenario, if the estimated delivery date does not correspond to any of the customer's preferences, the system will choose the preference of the closest day to the estimated date. After the company has registered a parcel for the customer successfully, the customer will receive a notification that a new parcel has been added to his/her account.  When the customer clicks on one of the parcels, he/she will be redirected to a screen containing the details of that parcel, as shown in Fig. 12. The delivery preferences desired by the customer appear at the bottom of the screen. When the customer clicks on "Edit Preferences," he/she can change the preferred day, period of time, and location. Also, he/she can choose a specific delivery date. "Status" describes the company's response to the preferences provided by the customer. The most prominent feature of the system is that, provided the app can access the customer's current location, the system will measure the distance between that location and the parcel delivery location on the day before the parcel is to be delivered to the customer. If the distance is greater than 85 km, the customer will be notified and asked if he/she would prefer to change the parcel delivery location to his/ her current location or whether he/she wished to continue with the registered location.

Testing
In this section, testing of the system is evaluated from two perspectives: the first is technical testing in which the system is tested to check if it works as intended, while the second is testing end-user acceptance.

Technical Testing
Before releasing the My Parcel system to end-users, it must be reviewed and tested to make sure that it works as expected. The three main types of technical testing are unit testing, integration testing, and system testing [34].

-Unit Testing
Each module is tested separately to try to detect any errors in its code [34]. Unit testing was applied to the application (app) units, such as logging in and out, registering and deleting data, and modifying user data. It was also applied to the website units, such as logging in and out, registering new parcels, etc.

-Integration Testing
Integration testing means that several units are combined as a group and then tested [34]. At this point, the units are integrated together into subsystems and testing ensures that each unit's interface (or interfaces) behave/s according to its (or their) specification [35].
-System Testing All subsystems are combined to represent the complete final system which is then tested as a whole [35]. As shown in the implementation section, the system works as intended.

Acceptance Testing
This test is conducted to evaluate the success and acceptance of the system by end-users [34]. Testing is necessary to explore users' perceptions toward the system design, social impacts, and trust which affect the use of the system by potential users. This type of test could be conducted by adopting models and theories that have been used previously to examine users' acceptance of e-commerce services and applications. These models include the unified theory of acceptance and use of technology (UTAUT) [36], The technology acceptance model (TAM) [37], WEBQUALTM [38] with the latter being an approach which quantifies a website's quality.
However, due to the coronavirus (COVID-19) pandemic currently being experienced worldwide, with precautionary measures having been taken in Saudi Arabia to limit the spread of the virus, including curfews and suspending most businesses, the field experiment could not be conducted. Therefore, this testing will be done in the future.

Results and Discussions
According to the related studies and works mentioned in Section 2.2, the biggest issue about which logistics companies and their customers complain is the absence of the customer during the time of delivery. Repeated deliveries lead these companies to incur huge losses, thus reducing their profitability. Customers are also dissatisfied with delivery times that are unsuitable, having to change appointments or needing to pick up the parcels themselves. Previous studies and related works have mentioned several solutions and suggestions [1,5,7]. Although these are not analogous to this project proposal, their suggestions and solutions were also aimed at solving the same issues faced by companies and customers that this project proposal has sought to do. This project has achieved its primary goal of enhancing e-commerce services, and particularly the delivery service, as the system built by the project serves logistics companies and their customers during the delivery process. The system facilitates communication and coordination between the two parties. Therefore, the whole delivery process is more convenient and reliable as the customer can determine the exact time, location, and days that are appropriate for him/her. Consequently, this helps companies to reduce the failed delivery rate as they deliver the parcel to the customer when they are certain of his/her presence.

Contribution
The study focuses on last mile delivery which encompasses activities for which app-based and webbased delivery platforms have emerged. The project's technical contribution is that it has developed a system that facilitates coordination between all parties involved in the delivery process. As has been argued, a mismatch occurs in last mile delivery between scientific solutions and practical challenges [8].
Customers evaluate e-commerce companies based on their entire shopping experience, including the website, communication services, delivery options, and actual delivery experience [6]. Therefore, webbased delivery platforms could be appropriate delivery options, possibly increasing purchase frequency and intensity. Our proposed system helps customers, logistics service providers, and retailers (e-tailers) to choose more sustainable last mile delivery options. This study provides insights into how a web-based platform could influence e-commerce users' behavior in relation to the delivery service.

Conclusion and Future Work
This study introduces a solution that facilitates and accelerates the process of communication between logistics companies and their customers. Many companies, institutions, and retailers today have turned to ecommerce due to its advantages. Individuals also prefer shopping online due to the availability of goods from different countries and industries. However, the critical stage between electronic sellers and online buyers is the delivery stage. In this study's questionnaire on online shopping, answers to one question showed that 84.2% of respondents believed that delivery options had a large influence on their online shopping decisions. This provided evidence that the delivery service is one of the most important e-commerce services, having a significant impact on both parties. Based on the most important concepts related to ecommerce, the questionnaire's results, and prior studies examining delivery problems faced by customers and logistics companies, the study developed and proposed a solution. In the practical part of the project, the system being developed was divided into two parts, the first to develop a website that serves logistics companies, and the second to develop an app that serves customers of these companies. During the development of the system, all technical tests were carried out and the system was verified. Thus, the system is ready to be experienced by end-users.
The drawback of this study is that the system built has not been tested in a real-world situation. As mentioned in Section 5.2.2, acceptance testing has not been applied to the proposed system due to the current circumstances arising from the COVID-19 pandemic. Therefore, applying this form of testing will be one of the first and most important actions in the future to learn the extent of the system's acceptance by end-users and their opinions and suggestions. The project is also willing to add features to the system that will, in turn, add several benefits for users, thus improving their experience. These features include: Supporting multiple mobile application platforms. Supporting several languages. Adding a parcel tracking feature. Adding user tracking features in addition to the user's live location. Improving the website through examining logistics companies' systems to determine the way these systems work so the two systems can be combined.