Skip to content

adamlc/go-utm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UTM Tag Builder

Travis Go Report Card codecov

Use UTM Tag Builder to add Google utm tags to a URL.

Installation

go get -u github.com/adamlc/go-utm

Usage

url, err := utm.BuildURL("https://test.com", utm.Config{
	Source: "google",
	Medium: "email",
	Campaign: "Awesome Test"},
)

// https://test.com?utm_campaign=Awesome+Test&utm_medium=email&utm_source=google

func BuildURL

func BuildURL(rawurl string, config Config) (string, error)

BuildURL adds UTM tags to the passed URL

type Config

type Config struct {
	Source   string
	Medium   string
	Campaign string
	Content  string
	Term     string
}

Config is used to configure UTM tags for a URL

About

Utility to add Google UTM tags to a URL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages