Skip to content

Commit

Permalink
Add tool name to GA4 feedback component
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGDS committed Apr 18, 2024
1 parent 474443e commit 171fe91
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@

<%
unless disable_ga4
heading_text = t("components.feedback.help_us_improve_govuk", locale: :en)
ga4_submit_button_event = {
event_name: "form_submit",
type: "feedback",
text: t("components.feedback.send", locale: :en),
section: t("components.feedback.help_us_improve_govuk", locale: :en),
section: heading_text,
tool_name: heading_text
}.to_json
end
%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@

<%
unless disable_ga4
heading_text = t("components.feedback.help_us_improve_govuk", locale: :en)
ga4_send_button_event = {
event_name: "form_submit",
type: "feedback",
text: t("components.feedback.send_me_survey", locale: :en),
section: t("components.feedback.help_us_improve_govuk", locale: :en),
section: heading_text,
tool_name: heading_text
}.to_json
end
%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<%
unless disable_ga4
heading_text = t("components.feedback.is_this_page_useful", locale: :en)
ga4_yes_button_event = {
"event_name": "form_submit",
"type": "feedback",
"text": t("components.feedback.yes", locale: :en),
"section": t("components.feedback.is_this_page_useful", locale: :en),
"text": t("components.feedback.yes", locale: :en),
"section": heading_text,
"tool_name": heading_text,
}.to_json

ga4_no_button_event = {
"event_name": "form_submit",
"type": "feedback",
"text": t("components.feedback.no", locale: :en),
"section": t("components.feedback.is_this_page_useful", locale: :en)
"section": heading_text,
"tool_name": heading_text,
}.to_json

ga4_problem_button_event = {
"event_name": "form_submit",
"type": "feedback",
"text": t("components.feedback.something_wrong", locale: :en),
"section": t("components.feedback.is_this_page_useful", locale: :en)
"section": heading_text,
"tool_name": heading_text,
}.to_json
end
%>
Expand Down

0 comments on commit 171fe91

Please sign in to comment.