Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add utm query parameters to docs links in module.calls and module.providers #911

Closed
radeksimko opened this issue May 5, 2022 · 1 comment · Fixed by #923
Closed

Add utm query parameters to docs links in module.calls and module.providers #911

radeksimko opened this issue May 5, 2022 · 1 comment · Fixed by #923
Assignees
Labels
enhancement New feature or request

Comments

@radeksimko
Copy link
Member

Background

We are already able to tell how many visitors of the Terraform Registry came there through the language server thanks to the "utm" query parameters in URLs, for example:

  • utm_content=documentLink
  • utm_medium=Visual+Studio+Code
  • utm_source=terraform-ls

This includes provider docs

Screenshot 2022-05-05 at 14 19 17

and recently merged module docs

Screenshot 2022-05-05 at 14 19 56

We do not however use these params in URLs exposed for the module or provider views, which means we're unable to measure usage/impact of these:

Screenshot 2022-05-05 at 14 34 53

Screenshot 2022-05-05 at 14 35 08

Proposal

Add appropriate UTM params to URLs exposed via module.calls or module.providers commands:

func getProviderDocumentationLink(provider tfaddr.Provider) string {
if provider.IsLegacy() || provider.IsBuiltIn() || provider.Hostname != "registry.terraform.io" {
return ""
}
return fmt.Sprintf(`https://registry.terraform.io/providers/%s/latest`, provider.ForDisplay())
}

func getModuleDocumentationLink(record datadir.ModuleRecord) string {
if record.GetModuleType() != datadir.TFREGISTRY {
return ""
}
shortName := strings.TrimPrefix(record.SourceAddr, "registry.terraform.io/")
return fmt.Sprintf(`https://registry.terraform.io/modules/%s/%s`, shortName, record.VersionStr)
}

e.g.

  • utm_content=command/module.providers
  • utm_medium=Visual+Studio+Code
  • utm_source=terraform-ls
@radeksimko radeksimko added the enhancement New feature or request label May 5, 2022
@radeksimko radeksimko self-assigned this May 27, 2022
@github-actions
Copy link

github-actions bot commented Jul 1, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant