Skip to content

Commit

Permalink
Merge pull request #4638 from alphagov/ga4-parameters-2
Browse files Browse the repository at this point in the history
Add GA4 parameter names into GA4 implementation record
  • Loading branch information
andysellick authored May 9, 2024
2 parents fdf9769 + 07d47f1 commit 9b97f8e
Show file tree
Hide file tree
Showing 8 changed files with 511 additions and 46 deletions.
9 changes: 8 additions & 1 deletion config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ def sanitize(contents)

data.analytics.attributes.each do |attribute|
attribute_name = attribute["name"].downcase.gsub(" ", "_")
proxy "analytics/attribute_#{attribute_name}.html", "analytics/templates/attribute.html", locals: { attribute: }
proxy "analytics/attribute_#{attribute_name}.html", "analytics/templates/attribute.html", locals: { attribute:, variant: nil }

next unless attribute.variants

attribute.variants.each do |variant|
variant_name = variant["event_name"].downcase.gsub(" ", "_")
proxy "analytics/attribute_#{attribute_name}/variant_#{variant_name}.html", "analytics/templates/attribute.html", locals: { attribute:, variant: }
end
end

data.analytics.trackers.each do |tracker|
Expand Down
Loading

0 comments on commit 9b97f8e

Please sign in to comment.