Skip to content

Commit

Permalink
Moved raptive code to head element
Browse files Browse the repository at this point in the history
  • Loading branch information
Spicer Matthews committed Jan 12, 2024
1 parent 71d0e8e commit b8df929
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
17 changes: 17 additions & 0 deletions src/components/TabCMPHeadElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ import React from 'react'
// https://github.com/gladly-team/tab-cmp/blob/master/src/tagModified.html
const TabCMPHeadElements = () => (
<>
<script
dangerouslySetInnerHTML={{
__html: `(function(w, d) {
w.adthrive = w.adthrive || {};
w.adthrive.cmd = w.adthrive.cmd || [];
w.adthrive.plugin = 'adthrive-ads-manual';
w.adthrive.host = 'ads.adthrive.com';
var s = d.createElement('script');
s.async = true;
s.referrerpolicy='no-referrer-when-downgrade';
s.src = 'https://' + w.adthrive.host + '/sites/655cd66352dfc71af0778a48/ads.min.js?referrer=' + w.encodeURIComponent(w.location.href) + '&cb=' + (Math.floor(Math.random() * 100) + 1);
var n = d.getElementsByTagName('script')[0];
n.parentNode.insertBefore(s, n);
})(window, document);`,
}}
/>

<script
type="text/javascript"
data-cfasync="false"
Expand Down
17 changes: 0 additions & 17 deletions src/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@ class CustomDocument extends Document {
<TabCMPHeadElements />
</Head>
<body style={{ margin: 0, padding: 0 }}>
<script
dangerouslySetInnerHTML={{
__html: `(function(w, d) {
w.adthrive = w.adthrive || {};
w.adthrive.cmd = w.adthrive.cmd || [];
w.adthrive.plugin = 'adthrive-ads-manual';
w.adthrive.host = 'ads.adthrive.com';
var s = d.createElement('script');
s.async = true;
s.referrerpolicy='no-referrer-when-downgrade';
s.src = 'https://' + w.adthrive.host + '/sites/655cd66352dfc71af0778a48/ads.min.js?referrer=' + w.encodeURIComponent(w.location.href) + '&cb=' + (Math.floor(Math.random() * 100) + 1);
var n = d.getElementsByTagName('script')[0];
n.parentNode.insertBefore(s, n);
})(window, document);`,
}}
/>

{/**
* Begin: Ads code.
* See: https://github.com/gladly-team/tab-ads#html-tags
Expand Down

0 comments on commit b8df929

Please sign in to comment.