Pegasus83 Posted August 7, 2015 Share Posted August 7, 2015 Hi guys,I updated this night from 3.4.8 to 4.0.12. In the old Forum I had a mobile skin with a different analytics code from the desktop one.How could I set the new (and single) skin to load different scripts if the user is on desktop or mobile (phone and tablet)?I tried with <code><div class="ipsClearfix ipsResponsive_showDesktop ipsResponsive_hideTablet ipsResponsive_hidePhone"></code>But it does not workThanks! Link to comment Share on other sites More sharing options...
Lukeroge Posted August 7, 2015 Share Posted August 7, 2015 Can't you just filter the end results? Using two different codes seems a bit silly. Link to comment Share on other sites More sharing options...
Pegasus83 Posted August 7, 2015 Author Share Posted August 7, 2015 Can't you just filter the end results? Using two different codes seems a bit silly.Yes, I could, but I need it for my stats. A solution could be useful also for other aims.I think it's related to a "if" statement, but I don't know how 4.0 manages these codes. Link to comment Share on other sites More sharing options...
Jim M Posted August 7, 2015 Share Posted August 7, 2015 Unfortunately, as it is javascript you cannot use CSS classes to hide it as it will execute no matter what. You could use some jQuery or Javascript to detect if the window width is below 1024px (that would mean it's a tablet or mobile device) then use a variable to change out your Google analytics property ID accordingly. Link to comment Share on other sites More sharing options...
Pegasus83 Posted August 7, 2015 Author Share Posted August 7, 2015 Unfortunately, as it is javascript you cannot use CSS classes to hide it as it will execute no matter what. You could use some jQuery or Javascript to detect if the window width is below 1024px (that would mean it's a tablet or mobile device) then use a variable to change out your Google analytics property ID accordingly. {{if in_array('ipsLayout_minimal', \IPS\Output::i()->bodyClasses )}}can't this help me? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.