Expand my Community achievements bar.

SOLVED

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

Avatar

Community Advisor

Hi All,

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

Could you please guide. Thank you

kamleshmaddheshiya_0-1682426193905.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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.




 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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.




 

Avatar

Community Advisor

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.