Skip to content

Commit

Permalink
Fix DA cards feedback analytics (#978)
Browse files Browse the repository at this point in the history
Only show thumbs up/down feedback buttons on direct answer cards when user provides `businessId` and enables analytics.

J=SLAP-1175
TEST=manual

Smoke testing to check if feedback buttons only appear on DA cards when expected.
  • Loading branch information
nmanu1 committed Oct 13, 2021
1 parent de779cd commit dd89e78
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion directanswercards/allfields-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
{{> cta CTA linkTarget=linkTarget}}
</div>
{{/if}}
{{> footer }}
{{#if feedbackEnabled}}
{{> footer }}
{{/if}}
</div>

{{#*inline 'icon'}}
Expand Down
1 change: 1 addition & 0 deletions directanswercards/card_component.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ BaseDirectAnswerCard["{{componentName}}"] = class extends ANSWERS.Component {

return super.setState({
...cardData,
feedbackEnabled: ANSWERS.getAnalyticsOptIn(),
feedbackSubmitted: data.feedbackSubmitted,
isArray: Array.isArray(this.answer.value),
cardName: `{{componentName}}`,
Expand Down
4 changes: 3 additions & 1 deletion directanswercards/documentsearch-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
{{> cta CTA linkTarget=linkTarget}}
</div>
</div>
{{> footer}}
{{#if feedbackEnabled}}
{{> footer }}
{{/if}}
</div>

{{#*inline 'title'}}
Expand Down
4 changes: 3 additions & 1 deletion directanswercards/multilang-allfields-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
{{> cta CTA linkTarget=linkTarget}}
</div>
{{/if}}
{{> footer }}
{{#if feedbackEnabled}}
{{> footer }}
{{/if}}
</div>

{{#*inline 'icon'}}
Expand Down
2 changes: 1 addition & 1 deletion global_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdkVersion": "develop", // The version of the Answers SDK to use
"sdkVersion": "release/v1.11", // The version of the Answers SDK to use
// "apiKey": "<REPLACE ME>", // The answers api key found on the experiences page. This will be provided automatically by the Yext CI system
// "experienceVersion": "<REPLACE ME>", // the Answers Experience version to use for API requests. This will be provided automatically by the Yext CI system
// "businessId": "<REPLACE ME>", // The business ID of the account. This will be provided automatically by the Yext CI system
Expand Down
2 changes: 1 addition & 1 deletion test-site/config/global_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdkVersion": "develop", // The version of the Answers SDK to use
"sdkVersion": "release/v1.11", // The version of the Answers SDK to use
"apiKey": "2d8c550071a64ea23e263118a2b0680b", // The answers api key found on the experiences page. This will be provided automatically by the Yext CI system
// "experienceVersion": "<REPLACE ME>", // the Answers Experience version to use for API requests. This will be provided automatically by the Yext CI system
// "businessId": "<REPLACE ME>", // The business ID of the account. This will be provided automatically by the Yext CI system
Expand Down

0 comments on commit dd89e78

Please sign in to comment.