@@ -45,17 +45,18 @@ import (
4545
4646// Metadata constants for the YAML header
4747const (
48- MetaAuthors = "authors"
49- MetaSummary = "summary"
50- MetaID = "id"
51- MetaCategories = "categories"
52- MetaEnvironments = "environments"
53- MetaStatus = "status"
54- MetaFeedbackLink = "feedback_link"
55- MetaAnalyticsAccount = "analytics_account"
56- MetaTags = "tags"
57- MetaSource = "source"
58- MetaDuration = "duration"
48+ MetaAuthors = "authors"
49+ MetaSummary = "summary"
50+ MetaID = "id"
51+ MetaCategories = "categories"
52+ MetaEnvironments = "environments"
53+ MetaStatus = "status"
54+ MetaFeedbackLink = "feedback_link"
55+ MetaAnalyticsAccount = "analytics_account"
56+ MetaAnalyticsGa4Account = "analytics_ga4_account"
57+ MetaTags = "tags"
58+ MetaSource = "source"
59+ MetaDuration = "duration"
5960)
6061
6162const (
@@ -182,7 +183,7 @@ type docState struct {
182183 survey int // last used survey ID
183184 step * types.Step // current codelab step
184185 lastNode nodes.Node // last appended node
185- env []string // current enviornment
186+ env []string // current environment
186187 cur * html.Node // current HTML node
187188 stack []* stackItem // cur and flags stack
188189}
@@ -439,6 +440,9 @@ func addMetadataToCodelab(m map[string]string, c *types.Codelab, opts parser.Opt
439440 case MetaAnalyticsAccount :
440441 // Directly assign the GA id to the codelab field.
441442 c .GA = v
443+ case MetaAnalyticsGa4Account :
444+ // Directly assign the GA id to the codelab field.
445+ c .GA4 = v
442446 case MetaTags :
443447 // Standardize the tags and append to the codelab field.
444448 c .Tags = append (c .Tags , util .NormalizedSplit (v )... )
0 commit comments