Forum OpenACS Development: Adding Google AdSense tags to page header

Request notifications

Hi there, Adding a script library in the header of an OpenACS website, to support Google AdSense, would be a pretty easy task.

Amending /www/blank-master.adp, by adding the follwing chunk in the last line before head closure

... <script data-ad-client="ca-pub-86757473464" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
</head>
...

However, I was wondering how would I use ad_proc template::head::add_javascript to this case

Being very specifically how would I pass the argument '... data-ad-client="ca-pub-86757473464"' through the ad_proc call.

Best wishes, I

/api-doc/proc-view?proc=template::head::add_script

Collapse
Posted by Brian Fenton on
Hi Iuri

I think you can just the -script parameter to template::head::add_javascript e.g. https://openacs.org/api-doc/proc-view?proc=template::head::add_javascript&source_p=1

Brian