Skip to content

Graphs of trends around web searches, social media and economic indicators

License

Notifications You must be signed in to change notification settings

MichaelCurrin/trends

Repository files navigation

Trends

Graphs of trends around web searches, social media and economic indicators

GitHub tag License

Made with Jekyll

View site - GH Pages

Contribute

Add Google Trends

Follow the Google Trends section below to do a search. Then send the URL from the address bar to me so I can tweak it and then embed graphs as a post.

Data sources

Google Trends

Use the UI on website to do searches. Choose a "search term" phrase or a topic from the droplist. Up to 5 items can be added.

Help page on sharing Google Trends searches and embedding:

Do a search

  1. Start with a template search.
  2. Edit the existing term and add any more if relevant. You can set to 5 terms at once. Where possible, select a concept rather than a search term (plain text), as the concept can mix together terms based on context. e.g. "frozen" is generic, but "Frozen" "The Film" will exclude frozen foods. Extra words can help - "blues" is limited but "blues music" let's you pick "Blues (genre)" as a topic.
  3. Optionally upate these:
    • Location e.g. United States, Texas, South Africa, Western Cape.
    • Date range - longer or shorter period, or a fixed period.
    • Category. This can be useful to avoid noise in search terms - "blues" means something different in art, music and emotions.

Share search results

  1. Copy the URL in the address bar.
  2. Send the URL to someone so they can see the same view as you. If I've asked you to help contribute to this project, send me that URL.

Embedding

After I have a created a search or someone has sent me a URL, then I pick a widget and click the code button to get a JS snippet. I then add them to my Trends website.

See below for a example of embedded data snippet for "Interest over Time" widget. Note that each consists of two scripts when copy and pasted - one for the loader library and one with the actual parameters.

  • Keep data updated with a look-back period from today. e.g. today 5-y
    <script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/2051_RC11/embed_loader.js"></script>
    <script type="text/javascript"> trends.embed.renderExploreWidget("TIMESERIES", {"comparisonItem":[{"keyword":"foo","geo":"","time":"today 5-y"}],"category":0,"property":""}, {"exploreQuery":"date=today%205-y&q=foo","guestPath":"https://trends.google.com:443/trends/embed/"}); </script>
  • Static data. This fixes the date range. e.g. 2015-01-07 2020-01-07
    <script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/2051_RC11/embed_loader.js"></script>
    <script type="text/javascript"> trends.embed.renderExploreWidget("TIMESERIES", {"comparisonItem":[{"keyword":"foo","geo":"","time":"2015-01-07 2020-01-07"}],"category":0,"property":""}, {"exploreQuery":"date=today%205-y&q=foo","guestPath":"https://trends.google.com:443/trends/embed/"}); </script>

License

Released under MIT by @MichaelCurrin.