Install with the script
It works on any site where you can paste HTML.
- Open sentirsocial.com/en/widgets and pick the widget, the language, the theme and the width.
- Copy the code.
- Paste it into your page’s HTML, where the chart should appear.
The code looks like this:
<div data-sentir-widget="WIDGET-ID"><a href="https://sentirsocial.com/reportes/...">Data: Sentir Social</a></div><script async src="https://sentirsocial.com/widget.js"></script>- The
divmarks the place. The script puts the chart there and gives it the height it needs. - With several widgets on one page, repeat the
divand keep thescriptline once.
Options
Section titled “Options”They go on the div:
| Attribute | Values | If you leave it out |
|---|---|---|
data-lang |
es, en |
Your page’s language; Spanish when unknown. |
data-theme |
light, dark, auto |
auto: light or dark from the viewer’s system. |
data-width |
a number of pixels, for example 480 |
All the width there is. |
An example, in English, dark and at most 480 px wide:
<div data-sentir-widget="WIDGET-ID" data-lang="en" data-theme="dark" data-width="480"></div>The widget always shrinks on small screens: data-width is a maximum width.
Without the script
Section titled “Without the script”If your site allows no scripts, use a frame directly. You set the height yourself:
<iframe src="https://sentirsocial.com/embed/WIDGET-ID?lang=en" title="Sentir Social" width="100%" height="420" style="border:0" loading="lazy"></iframe>Leave out ?lang=en for Spanish; to force the theme, add #theme=dark or #theme=light at the end of the address.
What the script does on your page
Section titled “What the script does on your page”- It inserts the frame with the chart and fits its height.
- It sets no cookies, stores nothing in the browser and reads nothing of your page or your readers.
- It weighs under 3 KB and loads asynchronously, so it does not slow your page.