mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-31 11:35:45 +00:00
Separate mobile and desktop ads
This commit is contained in:
@@ -12,5 +12,8 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.map"></script>
|
||||
|
||||
<!--Mobile and tablet detection-->
|
||||
<script type='text/javascript' src="//wurfl.io/wurfl.js"></script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
<% if Rails.env.production? %>
|
||||
<div class="ad">
|
||||
<script type="text/javascript">
|
||||
if(WURFL.is_mobile){
|
||||
//Mobile and tablet ad
|
||||
(function(){
|
||||
CHITIKA = window.CHITIKA ? window.CHITIKA : {'units' : []};
|
||||
CHITIKA.publisher = 'cwimer';
|
||||
var s = document.createElement('script');
|
||||
s.src = '//cdn.chitika.net/getads.js';
|
||||
try { document.getElementsByTagName('head')[0].appendChild(s); } catch(e) { document.write(s.outerHTML);}
|
||||
}())
|
||||
} else {
|
||||
//Desktop ad
|
||||
(function (){
|
||||
if(window.CHITIKA===undefined) {window.CHITIKA = {'units' :[]};};
|
||||
var unit = {"calltype":"async[2]","publisher":"cwimer","width":120,"height":600,"sid":"Chitika Default"};
|
||||
@@ -8,6 +19,7 @@
|
||||
window.CHITIKA.units.push(unit);
|
||||
document.write('<div id="chitikaAdBlock-' + placement_id + '"></div>');
|
||||
}());
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="//cdn.chitika.net/getads.js" async></script>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user