Skip to contents

This vignette is the detailed overview of this Notion Page

Setup a project in Qualtrics

Use g6tr_newsletter_setup() to setup an R, AWS and Qualtrics project.

You will need to get Qualtrics credentials in your .Renviron file.

To get them

  • log into qualtrics
  • -> Account Settings
  • -> Qualtrics IDS
  • -> Create Token

and fill your .Renviron with

QUALTRICS_APITOKEN = your_api_id
QUALTRICS_USER_ID = you_user_id

When calling g6tr_newsletter_setup() you should specify

R setup

  • survey_topic_title - this is the name used in AWS and in R project
  • overwrite - whether to overwrite already existing project with the same name, if it exists
  • new_branch - should a new git branch be created in R for this project
  • renv - should this project be using renv ecosystem

Qualtrics part

  • qualtrics_quota - whether to use gen-pop quotas, no quotas or custom quotas setup
  • qualtrics_name - the name of the project
  • qualtrics_redirects - for gen-pop quotas whether to use redirects to Dynata’s sandbox or production environment
  • qualtrics_userid - your Qualtrics user ID
  • qualtrics_apitoken - you Qualtrics API token
  • qualtrics_custom_surveyid - used when qualtrics_quota set to custom - create a new project based on this survey
g6tr_newsletter_setup <- 
      function(survey_topic_title = NULL, 
               overwrite          = FALSE, 
               new_branch         = FALSE,
               create_s3_bucket   = TRUE,
               renv               = TRUE,
               qualtrics_quota     = c('gen-pop', 'empty', 'custom'),
               qualtrics_name      = 'Qualtrics Project Name',
               qualtrics_redirects = c('sandbox', 'production'),
               qualtrics_userid    = Sys.getenv('QUALTRICS_USER_ID'),
               qualtrics_apitoken  = Sys.getenv('QUALTRICS_APITOKEN'), 
               qualtrics_custom_surveyid = NULL
      )

Below call

g6tr_newsletter_setup('test_survey_topic', # executed at 2019-12
                      new_branch = TRUE)

Fill the project in Qualtrics

When you have called g6tr_newsletter_setup() a .yml file is created for you with below lines. Thanks to that file you know the address under which a Qulatrics project was created.

aws_bucket: s3://monorepo-data/newsletter/2019-12_test_survey_topic
qualtrics_project_id: SV_2sCd02AxJrExIKF
qualtrics_project: https://gradientmetrics.az1.qualtrics.comQ/EditSection/Blocks?ContextSurveyID=SV_2sCd02AxJrExIKF
qualtrics_survey: https://gradientmetrics.az1.qualtrics.com/jfe/form/SV_2sCd02AxJrExIKF

Go to qualtrics_project and fill the rest of the questions manually. If you would like to keep reusing the same set of questions in monthly or periodically waves, keep using qualtrics_custom_surveyid option in g6tr_newsletter_setup() once the project is created.

Setup a project in Dynata

Once you are satisfied of your Qualtrics project, you are able to set a Dynata project to collect data from their panelists. There are 1 type of Quota specification you can use - gen population for US.

dynata_newsletter_config(
 file = 'test.json', 
 project_id = 'Newsletter-Project', 
 survey_url = 'https://gradientmetrics.az1.qualtrics.com/jfe/form/SV_1R1GC6eoXjiBPrT'
)

Test redirects with the verification url

dynata_newsletter_url(
 project_id = 'Newsletter-Project', 
 survey_url = 'https://gradientmetrics.az1.qualtrics.com/jfe/form/SV_1R1GC6eoXjiBPrT'
)

You can create Dynata project with

dynata_project_create(file = 'test.json', auth = dynata_auth(TRUE))

Buy the project in Dynata

If all is reviewed and works as intended, you can buy your project in Dynata with

dynata_project_buy(
   file = 'test.json', auth = dynata_auth(TRUE),
   project_id = 'Newsletter-Project'
)