Tia
Tia

Reputation: 41

Tracking traffic from mobile devices' home screen in Google Analytics

Does anyone know if it's possible to track website traffic coming specifically from a home screen icon on an Apple device?

E.g. when I specify the following HTML I can obviously control the image that appears when the user adds a shortcut on their homescreen:

<link rel="apple-touch-icon" href="touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="76x76" href="touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad-retina.png">
<etc, etc>

enter image description here

I'd like to know how many people are launching from their homescreen i.e. pressing the orange button in the above example. I don't think it's possible, but I was wondering if anyone had a trick up their sleeves?

TIA ♥

Upvotes: 4

Views: 755

Answers (1)

Valentin Podkamennyi
Valentin Podkamennyi

Reputation: 7369

navigator.standalone Returns a boolean indicating whether the browser is running in standalone mode. Available on Apple's iOS Safari only.

if (window.navigator.standalone) {
  // From home screen
}

From Safari Web Content Guide:

You can determine whether a webpage is displaying in standalone mode using the window.navigator.standalone read-only Boolean JavaScript property. For more on standalone mode, see apple-mobile-web-app-capable.

Upvotes: 2

Related Questions