top of page

Lessons learned when implementing Mobile App POS Observability using Dynatrace

Point of Sale (POS) monitoring plays a crucial role in modern business operations, serving as a critical tool for businesses to track transactions, manage inventory, and gain insights into consumer behavior. 


By monitoring POS systems, companies can 

  • Efficiently analyze sales trends

  • Identify popular products

  • Adjust pricing strategies accordingly

  • Detect and prevent fraudulent activities

  • Ensure the integrity and security of transactions 

  • Speed up decision-making

  • React swiftly to market demands 

  • Optimize their operations for maximum efficiency


In one of our projects, a customer implemented a new Android-based mobile App for point-of-sale (POS) terminals. Providing real-time observability insights for this POS was a requirement in this project.


POS Monitoring Requirements 

  • Mobile App versions are in use

  • In what locations are these Apps and POS devices in use

  • Reporting who is using the Mobile Apps

  • Reporting on which Terminal the payment actions origin

  • Reporting the number of successful payments

  • Reporting the number of failed payments

  • Reporting of communication-related errors

  • Reporting of response times

  • Reporting of user experience metrics




Configuration in Dynatrace

The AI-powered observability solution comes with a long list of mobile app monitoring capabilities. In our project, we've used the Android SDK and added the tracing libraries to our mobile payment's build path. 


In a second step, we've copied the Dynatrace configuration to the top-level build configuration of our Android App. 


apply plugin: 'com.dynatrace.instrumentation'
dynatrace {
configurations {
sampleConfig {
autoStart {
applicationId '<your auto generated id>'
beaconUrl '<your beacon url>/mbeacon'
}
userOptIn false / true
agentBehavior.startupLoadBalancing false / true
sessionReplay.enabled false /true
}
}
}

Finally, we've added the code below to visualize a privacy notice during startup, allowing the user to decline the tracing.


Dynatrace.applyUserPrivacyOptions(UserPrivacyOptions.builder()
.withDataCollectionLevel(DataCollectionLevel.USER_BEHAVIOR)
.withCrashReportingOptedIn(true)
.build());

After building the mobile app and running initial tests, Dynatrace visualized user actions.


Implementing Reporting Requirements

For reporting Terminal and Merchant, we added this code.


Dynatrace.modifyUserAction(modifiableUserAction -> {
    modifiableUserAction.reportValue("merchantid", "<merchid>");
    modifiableUserAction.reportValue("terminalid", "<termid>");
});

For reporting the Payment status, we extended the payment code in the mobile app and added the following:


DTXAction paymentAction = Dynatrace.enterAction("Payment <success / failed>");
paymentAction.reportValue("payment", “<success / failed>");
paymentAction.leaveAction();

For reporting the communication errors, we extended the error handling code in the mobile app and added the following:


DTXAction errorAction = Dynatrace.enterAction("Communication Error");
errorAction.reportValue("Error", “<Details about communication error>");
errorAction.leaveAction();

Implementing sanitization of PIN Codes at capture

POS devices provide several authentication features, such as using a PIN code after swiping your payment card. We've implemented sanitization at capture to ensure that your observability solution does not capture such PIN codes using the code below.


keyboardButton.setOnClickListener(new View.onClickListener(){
public void onClick(View v)
Dynatrace.modifyUserAction(UserAction -> {
userAction.setActionName("Touch on *");
   });
}
});

This code ensures that Dynatrace will not capture PIN codes.


Troubleshooting

Reporting events such as the payment status was initially challenging. After several debugging sessions, we've learned that no modification occurs if no user action is pending or is already closed upon modification.


Code that relies on open user action:

Dynatrace.modifyUserAction(.... -> { modifyUserAction.reportValue("payment", "failed"); });

We switched to creating our custom user action, which solved the issue. 


Code that creates a new user action:

DTXAction paymentAction = Dynatrace.enterAction("Payment <success / failed>");
paymentAction.reportValue("payment", “<success / failed>");
paymentAction.leaveAction();

Lessons learned

  • Clarify reporting requirements

  • Clarify data privacy requirements

  • Consider sanitization strategies 

  • Workshop with development teams

  • Review network layout and communication flow

  • Consider privacy settings

  • Create a custom user action when reporting values or events


Overall, POS monitoring is indispensable for businesses seeking to enhance competitiveness, streamline operations, and deliver exceptional customer experiences. We are happy to integrate Dynatrace to your business applications to improve the maturity of your observability practices.


Keep up the great work! Happy Performance Engineering!



.


39 views0 comments
bottom of page