Hello,
We have migrated our site to TagDiv Composer, latest version, from WP page builder. We are having issues with adding advertisement code (Javascript) via the raw html block.
When we paste the javascript code into the raw HTML block, two things happen:
- (not so bad) When we just add javascript that is not pulling anything in, the raw html block simply disappears and we are unable to edit it. We have to delete the whole column to be able to remove it and add another one. I’m guessing it’s because it adds a height of 0, since it’s just javascript. That’s not that much of a problem, because we can just delete the container column and start over for now.See the first js code sample below.
- (bad for us) When we add script that pulls in an ad (see the second js sample below), the page reloads either blank, or just with an ad. There is no option for us to save the page. so, we cannot add our ads onto pages at this time. We have a temporary fix by using the ad box, but we have way more ad types than what is allowed in the 5 custom ad spots in the newspaper panel. We even tried adding it to the text with title. There, we can paste the code into the ‘text’ editor, but we cannot save the page. We tried with all plugins off, except tagdiv composer, and same result. We just can’t seem to save the page with an ad in it. WP page builder allowed us to place any Javascript on any page.
Please advise.
———–
Sample code, which makes the block disappear, but we can save the page:
<!-- SAMPLE AD-300x250 [async] -->
<script type="text/javascript">if (!window.AdButler){(function(){var s = document.createElement("script"); s.async = true; s.type = "text/javascript";s.src = 'https://servedbyadbutler.com/app.js';var n = document.getElementsByTagName("script")[0]; n.parentNode.insertBefore(s, n);}());}</script>
Sample code, which when placed on a page, will pull in an ad from AdButler platform but cannot let us save:
<!-- SAMPLE AD-300x250 [async] -->
<script type="text/javascript">if (!window.AdButler){(function(){var s = document.createElement("script"); s.async = true; s.type = "text/javascript";s.src = 'https://servedbyadbutler.com/app.js';var n = document.getElementsByTagName("script")[0]; n.parentNode.insertBefore(s, n);}());}</script>
<script type="text/javascript">
var AdButler = AdButler || {}; AdButler.ads = AdButler.ads || [];
var abkw = window.abkw || '';
var plc197227 = window.plc197227 || 0;
document.write('<'+'div id="placement_197227_'+plc197227+'"></'+'div>');
AdButler.ads.push({handler: function(opt){ AdButler.register(165413, 197227, [300,250], 'placement_197227_'+opt.place, opt); }, opt: { place: plc197227++, keywords: abkw, domain: 'servedbyadbutler.com', click:'CLICK_MACRO_PLACEHOLDER' }});
</script>
-
This topic was modified 6 years by
pinnaclecompass. Reason: edited explanation of code snippet for clarity
Hi,
You can integrate/add the javascript code for ads by setting the code with tagDiv Composer on pages and cloud templates in a column text in text area -> https://i.imgur.com/quA2FCZ.png
Hope this will help you!
Thank you!
Hi Calin,
Thank you for the quick reply. We tried that as well. That didn’t work for us.
Doing it that way (as in the screenshot you provided) will not allow the page to save.
This is through the ‘content’ button option in a text block, like in your screenshot.
Any other workarounds?
Hi,
Please make sure that you have the latest version of the theme (Newspaper v10.3).
If there is still a problem, you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.
Thank you!
Hello, I didn’t want to start a new thread, but I’m having the exact same issue.
I used the raw HTML block to use a js code that runs a video ad. When I try to edit the page, the only thing that shows up is the ad itself. Everything above and below is gone. No matter what I do to make changes nothing works.
Please advise.
Hello !
Please contact us via email at contact@tagdiv.com and provide the following:
– admin url and credentials
– cPanel url and credentials
– A link to this topic in order to identify you
Our team will take a look !
Thank you
Hi @rillc,
I just found a workaround for custom ads, which I completely missed.
There is a custom code tab when you add an ‘Ad box’ via the composer. the javascript we use works and saves fine via this option.
@tagdiv: It would still be nice to have a raw javascript box, like WP Bakery had, but for now, this custom code window in the ad box is a good-enough workaround for us.
(We use it for interactive image embeds.)
I didn’t send login creds, because I just realized that we are on version 10.2 still on the site in question. We purchased this theme many times for multiple sites. I updated one of the other sites, and not the one in question. Once I update, this might fix this issue.
Thank you everyone for the quick replies.
-
This reply was modified 6 years by
pinnaclecompass.
@pinnaclecompass thank you for the information. It is very much appreciated. I will give it a try.
@pinnaclecompass thank you so much for this workaround, it worked perfectly!
It definitely feels like tagDiv should introduce a Raw JS block since the functionality is already there!
