Specific Use Cases
How to show Messenger Opt-in only on iPhones (all browsers)?
Steps to follow:
1. Complete the Messenger setup process.
2. The following piece of code needs to be placed before the </head>
tag of all website pages to achieve the desired outcome.
<script>
function isIOS() {
var iOS = /iPhone/.test(navigator.userAgent) && !/iPad/.test(navigator.userAgent) && !window.MSStream;
return iOS;
}
if (isIOS()) {
window._izq = window._izq || []; window._izq.push(["init"]);
} else {
window._izq = window._izq || []; window._izq.push(["init", {"messengerAutoPrompt": false}]);
}
</script>
<script src="https://cdn.izooto.com/scripts/******.js">
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
In line #12, replace the stars with hash js corresponding to your iZooto ID.
You can find the Hash.js on the iZooto Panel under settings.
![hash.png 928](https://files.readme.io/3227a55-hash.png)
Important
The iZooto JS needs to be placed only once.
Updated almost 2 years ago