Hello,
Thanks for the newest version of Streamlit 0.63 with the new feature of components, now I can insert javascript by components.html. However, After I insert the Google Adsense code using components.html, it only shows the blank at the position without loading any ads.
I tried just adding the code directly to the streamlit static page (index.html inside the package), and the ads showed up. So I think there should be a way to insert by component.
Any ideas?
Streamlit Components each run in their own iframe, to keep them sandboxed from other components. Taking a step back, this is effectively this feature request, which I hope we can find a solution for in the near future
Got it! thanks for your quick reply!!!
I think maybe I can just insert the code directly to the streamlit static index.html. But it will result in a mess (the ads will overlap the streamlit content. Is there a way to do some layout within index.html? For example, make the ads at the footer or header but not overlap with the streamlit content?
@tk16 âŚHelloâŚ
CongratsâŚon linking your streamlit-web to adsense.
Meanwhile, I am struggling for https:// custom-domain. com to access x.x.x.x:8501.
Could you please provide me a solution. As adsense requires ssl certification.
I am wondering whether I can embed google ads without the hack of index.html. I followed the procedure explained here but was not successful.
Here is what I did.
(1) I created a separate html-file with the code of Google Adsense (the code I found in Ads > by ad unit )
(2) Then, I copied the python code suggested by tobefined above and pasted it in my main.py file.
(3) I added my domain as âstreamlitapp.comâ and put my whole URL as a subdomain (b/c putting my whole URL as domain did not work).
(4) Requested review but failed.
I now realize that I may have missed another html code which should go in html âheadâ, but I am not sure⌠Are there two html codes? One going to âheadâ, and the other going to âbodyâ? If so, should I put both codes in my html file?
Google team replied that they rejected b/c my appâs server is down, but the app apparently works well⌠Can someone please help?