PWA install is tracking in Android but not in iOS using Adobe launch. | Community
Skip to main content
kamlesh-maddheshiya
Community Advisor
Community Advisor
April 25, 2023
Solved

PWA install is tracking in Android but not in iOS using Adobe launch.

  • April 25, 2023
  • 2 replies
  • 1391 views

Hi All,

PWA install is tracking in Android but not in iOS using Adobe launch.

Could you please guide. Thank you

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Hemang35

Create a custom event listener in your PWA to detect when the app is installed. This can be done using the beforeinstallprompt event for Android and a custom method for iOS. For iOS, you can use the window.navigator.standalone property to check if your PWA is running in standalone mode (which means it's installed).

function trackPWAInstall() {
if (window.matchMedia('(display-mode: standalone)').matches) {
// The PWA is running in standalone mode, which means it's installed.
// Fire your Adobe Launch tracking event here.
} else if ('standalone' in window.navigator && window.navigator.standalone) {
// The PWA is running in standalone mode on iOS, which means it's installed.
// Fire your Adobe Launch tracking event here.
}
}

// Call the trackPWAInstall function when the PWA starts or when the page is loaded.
trackPWAInstall();

Adobe Launch rule: Create a rule in Adobe Launch that listens for the custom event you created in step 1. This rule should include the appropriate Adobe Analytics tracking actions, such as sending a custom event or tracking a page view.

Test and validate: Test your PWA on both Android and iOS devices to ensure that the install event is being tracked correctly. You can use tools like Adobe Experience Cloud Debugger or Charles Proxy to monitor the tracking events sent to Adobe Analytics.


Keep in mind that the support for PWAs on iOS is still limited compared to Android, and some features might not work as expected. You may need to adapt your implementation to accommodate the differences between the two platforms.




 

2 replies

Hemang35
Hemang35Accepted solution
Level 5
April 25, 2023

Create a custom event listener in your PWA to detect when the app is installed. This can be done using the beforeinstallprompt event for Android and a custom method for iOS. For iOS, you can use the window.navigator.standalone property to check if your PWA is running in standalone mode (which means it's installed).

function trackPWAInstall() {
if (window.matchMedia('(display-mode: standalone)').matches) {
// The PWA is running in standalone mode, which means it's installed.
// Fire your Adobe Launch tracking event here.
} else if ('standalone' in window.navigator && window.navigator.standalone) {
// The PWA is running in standalone mode on iOS, which means it's installed.
// Fire your Adobe Launch tracking event here.
}
}

// Call the trackPWAInstall function when the PWA starts or when the page is loaded.
trackPWAInstall();

Adobe Launch rule: Create a rule in Adobe Launch that listens for the custom event you created in step 1. This rule should include the appropriate Adobe Analytics tracking actions, such as sending a custom event or tracking a page view.

Test and validate: Test your PWA on both Android and iOS devices to ensure that the install event is being tracked correctly. You can use tools like Adobe Experience Cloud Debugger or Charles Proxy to monitor the tracking events sent to Adobe Analytics.


Keep in mind that the support for PWAs on iOS is still limited compared to Android, and some features might not work as expected. You may need to adapt your implementation to accommodate the differences between the two platforms.




 

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
April 25, 2023

Can you share some of the code of how you are detecting the PWA install?

 

Have you connected your iOS device through a proxy to your computer and used a tool like Charles or Fiddler to see what (if anything) is being triggered in your tracking?

 

Even though this isn't an app. you can use Proxy testing to check your website tracking calls using a Proxy connection... I would suggest trying this first and seeing if you can debug first that way....

 

I suspect a lot of us don't have this feature on our sites, so we don't have a working model we look at.