Documentation
¶
Overview ¶
Package analytics provides a standard way to store the Google Analytics tracking ID.
Usage Example ¶
This analytics package provides a convenient way to configure an analytics ID for an app. To use, just call analytics.ID(c) and inject that ID into a template.
import (
...
"github.com/luci/luci-go/server/analytics"
...
)
func myHandler(c context.Context, rw http.ResponseWriter, r *http.Request, p httprouter.Params) {
...
return templates.Args{
"Analytics": analytics.Snippet(c),
}
}
And in the base html:
{{ .Analytics }}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ID ¶
ID returns the Google Analytics ID if it's set, and "" otherwise.
Types ¶
This section is empty.
Source Files
¶
- analytics.go
- doc.go
- settings.go
Click to show internal directories.
Click to hide internal directories.