Hi, I’ve enabled the FB messenger on my website, but I would like to have it show just on desktop and not show on mobile. Has anyone achieved this, or knows how to go about it?
TIA
Hello Anat
You can get what kind of device is being used to view the page and then you disable it if it was mobile (if statement condition). Check this documentation.
For further help please provide your website or editor URL.
Best
Massa
Thanks Massa!
Because the FB messenger doesn’t appear on the editor, and the code is in the tracking & analytics section, I thought writing the following code in the code panel, will not work (as I can’t see the messenger’s properties - meaning what would replace the #myelement in this code.
This is my website: www.anatbelinson.co.il
This is the code I have:
import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
$w.onReady( () => {
let windowType = wixWindow.formFactor;
if (windowType === “Mobile”){
$w(“#myelement”).show();
} **else** {
$w("#myelement").hide();
}
})
oops… the other way around:
import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
$w.onReady( () => {
let windowType = wixWindow.formFactor;
if (windowType === “Mobile”){
$w(“#myelement”).hide();
} **else** {
$w("#myelement").show();
}
})
Hey
I would suggest you try to detect the display in the app script. so if it is mobile let it return null (as not to run the code) if desktop let it run the code normally.
you cant customize the third party application to achieve that goal. and since it’s not an element you can’t hide it or show it.
I hope this works out
Massa