Skip to content

Commit

Permalink
Merge pull request #3767 from alphagov/ga4-fix
Browse files Browse the repository at this point in the history
Change GA4 type from licence to licence transaction
  • Loading branch information
AshGDS authored Sep 18, 2023
2 parents 563672a + ce700c7 commit dc07cb0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%
ga4_attributes = {
event_name: "form complete",
type: "licence",
type: content_item_hash["document_type"].gsub("_", " "),
text: "You cannot apply for this licence online",
action: "complete",
tool_name: publication.title,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/licence_transaction_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ class LicenceTransactionTest < ActionDispatch::IntegrationTest
expected_data_module = "ga4-auto-tracker"

ga4_auto_attribute = page.find("div[data-ga4-auto]")["data-ga4-auto"]
ga4_expected_object = "{\"event_name\":\"form complete\",\"type\":\"licence\",\"text\":\"You cannot apply for this licence online\",\"action\":\"complete\",\"tool_name\":\"Licence to kill\"}"
ga4_expected_object = "{\"event_name\":\"form complete\",\"type\":\"licence transaction\",\"text\":\"You cannot apply for this licence online\",\"action\":\"complete\",\"tool_name\":\"Licence to kill\"}"

assert_equal expected_data_module, data_module
assert_equal ga4_expected_object, ga4_auto_attribute
Expand Down

0 comments on commit dc07cb0

Please sign in to comment.