By using AWS re:Post, you agree to the Terms of Use

CloudFront and Google Analytics


I have deployed Google Analytics Script on my Lightsail-based WordPress (bitnami) website and using CloudFront for content delivery.

Besides I am using Wordfence Firewall on my website and accordingly enabled X-Forwarded-For HTTP header as well as whitelisted all IP Blocks of Cloudfront to get users ip.

The issue I am facing is that Google Analytics is displaying all visitors as originating from the desktop devices instead of mobile devices. How I can fix it?

The link to the website is

  • Can you enable logging on all components processing requests, e.g. CloudFront and WAF, and see if original user-agent has not been changed?