Rsurveygizmo: An R package for Interacting with the SurveyGizmo API

[This article was first published on R From Stata, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Several years ago our team began using SurveyGizmo for our online surveys (and, actually, a bunch of other projects as well, from polls to data entry templates). At the time, SurveyGizmo provided
a nice balance between cost and customization when compared to similar products from, e.g., Qualtrics and SurveyMonkey.
Over the years SurveyGizmo has greatly expanded the kinds of user customization and tweaking
that is possible, particularly in the area of API calls.
Because we mostly work in R, I decided to write a package that accesses the
SurveyGizmo API directly so that survey and email campaign data can
be pulled directly with a project script
(as opposed to manually downloading the data from the webpage).

Some usage examples for this package follow. To really test it out you will need to supply
your private SurveyGizmo API key and a valid survey id. There are many more function options
outlined in the package help files than are presented below for those who’d like to learn more.

<span class="c1">## Download a "regular" survey (that is, with no email campaign data), keeping only complete responses:
</span><span class="n">api</span> <span class="o"><-</span> <span class="s2">"_yourapikeyhere_"</span>

<span class="n">a_survey</span> <span class="o"><-</span> <span class="n">pullsg</span><span class="p">(</span><span class="m">1234</span><span class="p">,</span> <span class="n">api</span><span class="p">,</span> <span class="n">completes_only</span><span class="o">=</span><span class="n">T</span><span class="p">)</span>

<span class="c1">## Download all email campaign data for a particular survey:
</span>
<span class="n">a_campaign</span> <span class="o"><-</span> <span class="n">pullsg_campaign</span><span class="p">(</span><span class="n">surveyid</span><span class="p">,</span> <span class="n">api</span><span class="p">)</span> 

<span class="c1">## Combine the previous steps in one function, that is, download email campaign data and merge it, 
## where possible, with the survey response object (this will only work, of course, when there are 
## valid email campaigns associated with a survey project).
</span>
<span class="n">a_survey</span> <span class="o"><-</span> <span class="n">pullsg</span><span class="p">(</span><span class="m">1234</span><span class="p">,</span> <span class="n">api</span><span class="p">,</span> <span class="n">mergecampaign</span><span class="o">=</span><span class="n">T</span><span class="p">)</span>

If you’d like to give the package a spin, Rsurveygizmo can be installed in the usual way:

<span class="n">library</span><span class="p">(</span><span class="n">devtools</span><span class="p">)</span>
<span class="n">install_github</span><span class="p">(</span><span class="n">repo</span><span class="o">=</span><span class="s2">"DerekYves/rsurveygizmo"</span><span class="p">)</span>

I hope this package is helpful to somebody, and feel free to drop me an email or post to the repository if you have any questions or suggestions for improvement!

To leave a comment for the author, please follow the link and comment on their blog: R From Stata.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)