I always run the CPM.js through jsPretty.com, then you can always minify it after your edits if you wish, but I just leave it unminified. But it should work the way you did it.
Put the dtection script at the top just above function initializeCP(), but it works at the bottom also:
If you copy and pasted the code from the previous post, in the isMobile = false, there was an "i" missing from the variable "sMobile" change it to "isMobile"
<script>
var isMobile;
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
{
isMobile = true;
}
else
{
isMobile = false;
}
function initializeCP()