In Google CSE, when I attempt to get
Popular Queries, I'm getting this error in the
NetworkError: 400 Bad Request - http://www.google.com/cse/api/xxxxxxxxx:xxxxxxx/cse/xxxxxxx/queries/js?callback=(new+PopularQueryRenderer(document.getElementById(%27queries%27))).render .... .. ..
Why is it happening? I just simply copy/paste the code from Google:
<html> <head> </head> <body> <!-- CODE COPIED FROM GOOGLE : START --> <div id="queries"></div> <script src="http://www.google.com/cse/query_renderer.js"></script> <script src="http://www.google.com/cse/api/XXXX184908680XXXX:xxxxywrndxx/cse/xxxtywrnxxx/queries/js?callback=(new+PopularQueryRenderer(document.getElementById('queries'))).render"></script> <!-- CODE COPIED FROM GOOGLE : END --> </bodY> </html>
I just figured this out, at least for me. The code Google gives you is wrong. They give you the URL:
This puts the CSEID in twice. I was able to get it working by removing the first instance of the colon and the CSEID:
I'm not surprised they got confused: they use the term User Id to refer to the User string, but they use the term CSE Id to refer to both the portion after the colon and the combined User Id + colon + CSE Id.
©2020 All rights reserved.