Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.01 KB

README.md

File metadata and controls

43 lines (33 loc) · 1.01 KB

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