Introduction
For studies that track different advertisements over time, it's common to keep the structure of the data the same for easy data updates. However, the actual advertisements change over time and need to be accounted for.
Method
Where each advertising campaign is stored with separate variables, there are three strategies that can be employed. The first is to repeat the setup for each new campaign (this is the most time consuming and most error-prone approach). The second approach, which is the most technical approach but likely the most productive in the long-run is to write a QScript. The third approach is to use JavaScript, as follows:
- Create a list of all the advertisements and assign a unique value to each advertisement (e.g., 1 = description of first ad, 2 = description of second ad).
- In the Variables and Questions tab select Insert Variable(s) > JavaScript Variable > Numeric
-
- Name: advertisement.
- Label: Advertisement Number
- Expression:
-
-
- 1
- //1 = description of first ad
- //2 = description of second ad
-
-
-
- Note that the first line contains a 1 and the remaining lines just show the list of advertisements and unique values, where the // indicates that it is a comment rather than JavaScript.
-
- Use Copy and Paste Question(s) > Linked to copy the questions of the first advertisement.
- Manually edit each of the variables in the copied questions using an if statement, so that when you edit the Expression in the advertisement variable, all the linked questions automatically refer to the correct variables. These if statements will need to be updated every time a new campaign is added.
- Create any tables and new variables required to analyze the advertisement.
- When you wish to change advertisement, then change the value in the Expression in advertisement to the advertisement of interest. This will cause any variables and tables to automatically update.
NEXT
How to Compare Previous Periods Using an Unequal Categorical Variable
How to Compare your Results to the Previous Period in Q
How to Compare Two Waves of a Tracker in Different Data Files
How to Specify Columns to be Compared