Google Forms, Google Sheets (IMPORTXML), XML Path, WordPress
Note: This is part 3 of a larger project. Each part of the project is self-contained should you wish to reference just one particular aspect. Alternatively, you can follow along with the project to practise workflow and learn about Google Forms, Sheets, WordPress integration and a little HTML5 and Javascript. You can access the beginning of the project here:
Where We Left Off
After creating and embedding a Google Form into our WordPress post, in our last tutorial, we added a graph of all the results from the survey that updates every 30 seconds.
In this tutorial, we are going to add a country selection to our form and then embed a country heat map into our post.
Creating a Country Drop-Down List in Google Forms
The Countries List
Getting The Country Data
First off, we need to find a list of countries. I’m going to grab that from https://www.listofcountriesoftheworld.com. I could probably just copy the list and paste them in but I might want to use the list of countries again as a reference for other calculations in my sheet so I am going to go to my Google Sheet that is connected to my form and create a new Sheet tab named Countries.