Forum Moderators: open

Message Too Old, No Replies

How to Add a Custom Google Search to a Website with AMP

         

iniciopublic

4:53 pm on Jun 6, 2020 (gmt 0)

5+ Year Member Top Contributors Of The Month



hi i am trying to use the code I have my Google Custom Search Engine (GCSE) code:

<script async src="https://cse.google.com/cse.js?cx=009000000000000:u0000000"></script>
<div class="gcse-searchbox"></div>
<div class="gcse-searchresults"></div>


However, my Accelerated Mobile Pages (AMP) site does not allow me to add JavaScript to it, and I don't see any AMP components that allow GCSE to be integrated into an AMP site.

How can I get GCSE on my site without breaking AMP compliance? Can you think of any ideas?

Thank you

not2easy

5:06 pm on Jun 6, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



In AMP, the only option I am familiar with is using iframes. See this information page on that topic: [amp.dev...]

They offer a full listing of AMP guides and tutorials here: [amp.dev...]

This is not to say that GCSE is one of the scripts that can be used on AMP - I do not know that it is possible. The links I posted should help you find out how, if it can be done.