We have finished development for this blog the only thing remaining is google analytics and google Adsense.
for google analytics, we are using frontity google analytics package but somehow it does not work. can you please help us with that?
and for google Adsense we are using third party AdSense providers they give us small javascript to add in the head tag and another script tag which defines ad places, and then call their SPA hook with every route change So what is the best way to add script tag in the head we need to call after dom content loaded.
**Head script**
<script data-cfasync="false" type="text/javascript">
(function(w, d) {
var s = d.createElement('script');
s.src = '//[cdn.adpushup.com/38602/adpushup.js](http://cdn.adpushup.com/38602/adpushup.js)';
s.type = 'text/javascript'; s.async = true;
(d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
})(window, document);
</script>
add tag
336x280
<div id="2dd25ff6-e526-45f9-9b20-4cb6277fdbb2" class="_ap_apex_ad">
<script>
var adpushup = adpushup || {};
adpushup.que = adpushup.que || [];
adpushup.que.push(function() {
adpushup.triggerAd("2dd25ff6-e526-45f9-9b20-4cb6277fdbb2");
});
</script>
</div>
SPA hook
!function(){
window.adpushup.init();
}()
So we already added script tag in head and SPA hook but How can I insert add tag?