DudaMobile PHP Redirect to Solve Self-Referrals
If you still have an m(dot) mobile website, you really should switch to a responsive design, but that's another conversation for another time. Perhaps a responsive redesign isn't in the cards for your site right now and perhaps you happen to be a subscriber of turnkey mobile site provider DudaMobile. If so, you've probably noticed your Google Analytics reports are littered with self-referrals.
Unfortunately, DudaMobile's standard Javascript redirect is the culprit. Even worse, while DudaMobile provides a PHP redirect, it doesn't work. It appears their API is broken, as it identifies every browser as a desktop browser, regardless of the device.
Yep. Solid work, DudaMobile. You had one job.
That said, I wrote a new PHP redirect that will work. If you're running WordPress, you can just drop this into your theme's functions.php file located at: /wp-content/themes/(your-theme-name)/functions.php










