I’ve developed an android app for a news website(Wordpress) and taboola ads are active on it. I used framework7 and added to phonegap build and was able to generate APK. App is show all blog posts. Only issue is with ads. I’ve taboola add script but I’m unable to show those ads in app after each post.
Here’s what I did: Added ad script to head of index.html:
Code 1:
>
window._taboola = window._taboola || []; _taboola.push({ article: 'auto' }); ! function(e, f, u, i) { if (!document.getElementById(i)) { e.async = 1; e.src = u; e.id = i; f.parentNode.insertBefore(e, f); } }(document.createElement('script'), document.getElementsByTagName('script')[0], '//cdn.taboola.com/libtrc/domain/loader.js', 'tb_loader_script'); if (window.performance && typeof window.performance.mark == 'function') { window.performance.mark('tbl_ic'); } </script>
This ad code is added where ads need to be displayed: Code 2 Added 1st line at the end of post in “singlePost.vue” and code in head of index.html
<div id="taboola-below-article-thumbnails"></div>
<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({
mode: 'thumbnails-a',
container: 'taboola-below-article-thumbnails',
placement: 'Below Article Thumbnails',
target_type: 'mix'
});
</script>