Adding Google Analytics to your Tumblr mobile theme
Under the advanced section of the “customize” settings of your Tumblr blog there is the option to “use optimized mobile layout”.
Enabling this gives you a quick, clean, simple mobile version of your site which is shown automatically to mobile visitors.
One thing is lacks is any analytics script. You may have added Google Analytics to your regular Tumblr theme, but that won’t be included in this mobile version.
This means that no visits to your mobile version will be recorded.
The tumblr default mobile theme can’t be customised in the same easy way as your main (desktop) theme can.
To create a customised mobile theme and add Google Analytics, do the following:
- Create a new static page called /iphone-theme (it has to be called exactly that)
- Choose “Custom layout” as the page type
- Copy the default theme from this page on github and paste it in
- Add your Google Analytics code snippet just before the end of head section (follow the instructions given in GA)
- Make sure “use optimized mobile layout” is ticket in advanced settings
Give it a test and you should pretty soon start to see mobile visitors in your GA reports for your Tumblr site.