Put revenuehits in container

This commit is contained in:
2020-10-27 08:25:03 +01:00
parent 3734f1bd44
commit bc496c3998
4 changed files with 61 additions and 18 deletions

View File

@@ -154,6 +154,10 @@
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com">
<img src="/res/img/misc/banner_amarulasolutions.png" style="width: 100%; height: 100%" />
</a>
{{ else if eq .Other.AdType 6}}
<div id="348416176"></div>
{{ else if eq .Other.AdType 7}}
<iframe class="sponsors_banner" src="/ad/revenuehits" style="width:728px; height:90px; border:none; padding:0; overflow:hidden;" scrolling="no"></iframe>
{{end}}
</div>
{{end}}
@@ -248,9 +252,25 @@
{{template "analytics"}}
{{ if .Other.ShowAds }}{{ if eq .Other.AdType 5 }}
{{ if .Other.ShowAds }}
{{ if eq .Other.AdType 5 }}
<script data-cfasync="false" defer src="//d227cncaprzd7y.cloudfront.net/?acncd=905608"></script>
{{ end }}{{ end }}
{{ else if eq .Other.AdType 6}}
<script type="text/javascript">
window._mNHandle = window._mNHandle || {};
window._mNHandle.queue = window._mNHandle.queue || [];
medianet_versionId = "3121199";
</script>
<script src="https://contextual.media.net/dmedianet.js?cid=8CU832SZI" async="async"></script>
<script type="text/javascript">
try {
window._mNHandle.queue.push(function (){
window._mNDetails.loadTag("348416176", "728x90", "348416176");
});
} catch (error) {}
</script>
{{ end }}
{{ end }}
</body>
</html>
{{end}}

View File

@@ -0,0 +1,16 @@
{{ define "revenuehits" }}
<html>
<head>
<title>Ad Banner</title>
<style>
html, body {
margin: 0;
background-color: black;
}
</style>
</head>
<body>
<script data-cfasync='false' type='text/javascript' src='//p416901.clksite.com/adServe/banners?tid=416901_817726_0'></script>
</body>
</html>
{{ end }}

View File

@@ -33,25 +33,31 @@ func adType() (i int) {
// Intn returns a number up to n, but never n itself. So it get a random 0
// or 1 we need to give it n=2. We can use this function to make other
// splits like 1/3 1/4, etc
i = rand.Intn(8)
i = rand.Intn(5)
// The return value corresponds to the type of ad shown:
// 0: A-ads
// 1: Amarula Electronics
// 2: Patreon
// 3: Soul Studio Yoga
// 4: Amarula Solutions
// 5: Ad-Maven
const (
aAds = 0
amarulaElectronics = 1
patreon = 2
soulStudio = 3
amarulaSolutions = 4
adMaven = 5
mediaNet = 6
revenueHits = 7
)
switch i {
case 0, 1, 2: // 3/8 of the traffic
return 4 // Amarula solutions
case 0, 1:
return amarulaSolutions
case 3, 4, 5, 6: // 4/8 of the traffic
return 5 // Ad-Maven
case 2:
return adMaven
case 7: // 1/8 of traffic
return 2 // Patreon
case 3:
return mediaNet
case 4:
return revenueHits
default:
panic(fmt.Errorf(

View File

@@ -151,6 +151,7 @@ func New(
// Advertising related
{GET, "click/:id" /* */, wc.serveAdClick},
{GET, "campaign/:id" /* */, wc.serveCampaignPartner},
{GET, "ad/revenuehits" /**/, wc.serveTemplate("revenuehits", false)},
} {
r.Handle(h.method, prefix+"/"+h.path, h.handler)
}