Embed Tables and Charts in Web Pages
You can embed Q's tables and charts in any web page on the Internet. This will require a Dashboard, which requires a separate license to be purchased.
The following table is embedded from the demonstration dashboard http://www.q-demo.com page titled Tables and plots.
The embed code for this table is <script src='https://numberseus.blob.core.windows.net/embed/23/43/65f90523-1343-4208-b033-04ac5bc088db.js'></script>
You can use this embed code to test out the embedding functionality in your own web page.
Instructions for embedding a table in a web page
Get the HTML embed code
- Create the table in Q.
- Follow the steps in Instructions for creating a dashboard
- Go to your dashboard web page.
- Click the Edit button () to go into Edit mode.
- Click on the table, then click the Embed button:
- You will be instructed that a snapshot of your dashboard needs to be taken. Click Snapshot and View.
- The embed code will be generated. This may take up to one minute as a snapshot of your dashboard is performed.
- The embed code and a preview of the embedded table is shown:
- Select the embed code and copy it (CTRL+C on a PC).
Insert the HTML embed code into your web page
- If using a blog or other visual web page editor, switch to HTML mode. You should see your web page text surrounded by HTML tags such as <p>, <div>, etc.
- Paste the embed code into the editor.
- Save your web page.
- View your web page again. You may need to reload your web browser to see the changes (CTRL+R or CTRL+F5 in most web browsers).
- Edit your wiki page.
- Type <html>
- Paste the embed code afterwards.
- Then type </html> afterwards.
Note that this will only work if your MediaWiki software has the $wgAllowUserJs setting set to true. You should not turn this setting on if you have a public wiki, because it is a big security risk. It should only be turned on for private wikis where you trust the authors and prevent public editing.
Search Engine Optimization (SEO) concerns
The content of embedded tables, charts and text boxes is included in Google search results.
In late 2014 an experiment was conducted where a blog (http://embeddingtests.blogspot.com/) was created with several embedded items. It found:
- Upon Google's initial crawl of the web page, only text was captured. Embedded content was not included in search results.
- At a later stage (between 3-7 days), the embedded content was captured and included in search results.
This can still be confirmed today by searching for a word that is only included in the embedded table, such as "Less than 18": https://www.google.com/#q=site:embeddingtests.blogspot.com+%22Less+than+18%22