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?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking âAccept allâ, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.