Jump to content

Exclude Mobile Traffic


golffinder

Recommended Posts

  • 2 months later...
  • 8 months later...

We have managed to achieve this, It is via the limations box but we done all the work for you ;).  by doing the following.

 

1. Goto banner you do not want on mobile site.

2. Goto delivery options and add the following limitation: Client - Useragent

3.  Add this value: /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/  This will cover 98% of mobile users. Enter it exactly how it is above even with / at the beginning and end. The remaining 2% will be mobile users that have pre historic OS so any website built after 2004 wouldnt load of this type of device anyways so no worries in covering them.

4. Delete certain cache files to make change's instant or wait 20mins.

 

Location of cache files: var/cache

Files to remove: anything that starts with deliverycache_

 

Hope that helps

Link to comment
Share on other sites

  • 6 years later...

User Agent detection is not a recommended technique for modern web apps. You can use JavaScript window.matchMedia() method to detect a mobile device based on the CSS media query.

if (window.matchMedia("(max-width: 767px)").matches)
{
// The viewport is less than 768 pixels wide
document.write("This is a mobile device.");
}

Another approach would be a responsive media query. You could presume that a mobile phone has a screen size greater than x and less than y. 

For example:

@media only screen and (min-width: 320px) and (max-width: 600px) {}

You may also use navigator.userAgentData.mobile .

const isMobile = navigator.userAgentData.mobile;

 

Link to comment
Share on other sites

  • 2 months later...

To exclude mobile traffic we normally add filters in the dashboard.

As per the discussion we just need to avoid the banners displayed on mobile devices.

Then above mentioned patch of information will be very helpful.

Just by adding few plugins we can easily avoid the mobile displayed banners.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...