ga

package module
v0.0.0-...-9b3f149 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2017 License: MIT Imports: 5 Imported by: 1

README

Version 1.0b

This repository is forked from https://github.com/jpillora/go-ogle-analytics 2 May 2017 and added additional parameters to support sending multiple custom dimensions (see branch v1.0b)

Go-ogle Analytics

Track and monitor your Go programs for free with Google Analytics

The ga package is essentially a Go wrapper around the Google Analytics - Measurement Protocol

Warning This package is 95% generated from the Parameter Reference so it may contain bugs - please report them. GA allows "10 million hits per month per property" and will reject requests after that.

Install

go get -v github.com/jpillora/go-ogle-analytics

API

Create a new client and Send() a 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception' or 'timing' event.

http://godoc.org/github.com/jpillora/go-ogle-analytics

Quick Usage

  1. Log into GA and create a new property and note its Tracker ID

  2. Create a ga-test.go file

    package main
    
    import "github.com/jpillora/go-ogle-analytics"
    
    func main() {
    	client, err := ga.NewClient("UA-XXXXXXXX-Y")
    	if err != nil {
    		panic(err)
    	}
    
    	err = client.Send(ga.NewEvent("Foo", "Bar").Label("Bazz"))
    	if err != nil {
    		panic(err)
    	}
    
    	println("Event fired!")
    }
    
  3. In GA, go to Real-time > Events

  4. Run ga-test.go

    $ go run ga-test.go
    Event fired!
    
  5. Watch as your event appears

    foo-ga

MIT License

Copyright © 2015 <dev@jpillora.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	//Use TLS when Send()ing
	UseTLS     bool
	HttpClient *http.Client
	// contains filtered or unexported fields
}

Client Hit Type

func NewClient

func NewClient(trackingID string) (*Client, error)

func (*Client) Affiliation

func (h *Client) Affiliation(affiliation string) *Client

The store or affiliation from which this transaction occurred. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) AnonymizeIP

func (h *Client) AnonymizeIP(anonymizeIP bool) *Client

When present, the IP address of the sender will be anonymized. For example, the IP will be anonymized if any of the following parameters are present in the payload: &aip=, &aip=0, or &aip=1

func (*Client) ApplicationID

func (h *Client) ApplicationID(applicationID string) *Client

Application identifier.

func (*Client) ApplicationInstallerID

func (h *Client) ApplicationInstallerID(applicationInstallerID string) *Client

Application installer identifier.

func (*Client) ApplicationName

func (h *Client) ApplicationName(applicationName string) *Client

Specifies the application name.

func (*Client) ApplicationVersion

func (h *Client) ApplicationVersion(applicationVersion string) *Client

Specifies the application version.

func (*Client) CacheBuster

func (h *Client) CacheBuster(cacheBuster string) *Client

Used to send a random number in GET requests to ensure browsers and proxies don't cache hits. It should be sent as the final parameter of the request since we've seen some 3rd party internet filtering software add additional parameters to HTTP requests incorrectly. This value is not used in reporting.

func (*Client) CampaignContent

func (h *Client) CampaignContent(campaignContent string) *Client

Specifies the campaign content.

func (*Client) CampaignID

func (h *Client) CampaignID(campaignID string) *Client

Specifies the campaign ID.

func (*Client) CampaignKeyword

func (h *Client) CampaignKeyword(campaignKeyword string) *Client

Specifies the campaign keyword.

func (*Client) CampaignMedium

func (h *Client) CampaignMedium(campaignMedium string) *Client

Specifies the campaign medium.

func (*Client) CampaignName

func (h *Client) CampaignName(campaignName string) *Client

Specifies the campaign name.

func (*Client) CampaignSource

func (h *Client) CampaignSource(campaignSource string) *Client

Specifies the campaign source.

func (*Client) CheckoutStep

func (h *Client) CheckoutStep(checkoutStep int64) *Client

The step number in a checkout funnel. This is an additional parameter that can be sent when Product Action is set to 'checkout'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) CheckoutStepOption

func (h *Client) CheckoutStepOption(checkoutStepOption string) *Client

Additional information about a checkout step. This is an additional parameter that can be sent when Product Action is set to 'checkout'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ClientID

func (h *Client) ClientID(clientID string) *Client

This anonymously identifies a particular user, device, or browser instance. For the web, this is generally stored as a first-party cookie with a two-year expiration. For mobile apps, this is randomly generated for each particular instance of an application install. The value of this field should be a random UUID (version 4) as described in http://www.ietf.org/rfc/rfc4122.txt

func (*Client) Copy

func (h *Client) Copy() *Client

func (*Client) CouponCode

func (h *Client) CouponCode(couponCode string) *Client

The transaction coupon redeemed with the transaction. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) CurrencyCode

func (h *Client) CurrencyCode(currencyCode string) *Client

When present indicates the local currency for all transaction currency values. Value should be a valid ISO 4217 currency code.

func (*Client) CustomDimension

func (h *Client) CustomDimension(customDimension string) *Client

Each custom dimension has an associated index. There is a maximum of 20 custom dimensions (200 for Premium accounts). The dimension index must be a positive integer between 1 and 200, inclusive.

func (*Client) CustomDimensionMap

func (h *Client) CustomDimensionMap(customDimensionMap map[string]string) *Client

Each custom dimension has an associated index. There is a maximum of 20 custom dimensions (200 for Premium accounts). The dimension index must be a positive integer between 1 and 200, inclusive.

func (*Client) CustomMetric

func (h *Client) CustomMetric(customMetric int64) *Client

Each custom metric has an associated index. There is a maximum of 20 custom metrics (200 for Premium accounts). The metric index must be a positive integer between 1 and 200, inclusive.

func (*Client) DataSource

func (h *Client) DataSource(dataSource string) *Client

Indicates the data source of the hit. Hits sent from analytics.js will have data source set to 'web'; hits sent from one of the mobile SDKs will have data source set to 'app'.

func (*Client) DimensionIndex

func (h *Client) DimensionIndex(dimensionIndex string) *Client

DimensionIndex is required by other properties

func (*Client) DocumentEncoding

func (h *Client) DocumentEncoding(documentEncoding string) *Client

Specifies the character set used to encode the page / document.

func (*Client) DocumentHostName

func (h *Client) DocumentHostName(documentHostName string) *Client

Specifies the hostname from which content was hosted.

func (*Client) DocumentLocationURL

func (h *Client) DocumentLocationURL(documentLocationURL string) *Client

Use this parameter to send the full URL (document location) of the page on which content resides. You can use the &dh and &dp parameters to override the hostname and path + query portions of the document location, accordingly. The JavaScript clients determine this parameter using the concatenation of the document.location.origin + document.location.pathname + document.location.search browser parameters. Be sure to remove any user authentication or other private information from the URL if present. For 'pageview' hits, either &dl or both &dh and &dp have to be specified for the hit to be valid.

func (*Client) DocumentPath

func (h *Client) DocumentPath(documentPath string) *Client

The path portion of the page URL. Should begin with '/'. For 'pageview' hits, either &dl or both &dh and &dp have to be specified for the hit to be valid.

func (*Client) DocumentReferrer

func (h *Client) DocumentReferrer(documentReferrer string) *Client

Specifies which referral source brought traffic to a website. This value is also used to compute the traffic source. The format of this value is a URL.

func (*Client) DocumentTitle

func (h *Client) DocumentTitle(documentTitle string) *Client

The title of the page / document.

func (*Client) ExperimentID

func (h *Client) ExperimentID(experimentID string) *Client

This parameter specifies that this user has been exposed to an experiment with the given ID. It should be sent in conjunction with the Experiment Variant parameter.

func (*Client) ExperimentVariant

func (h *Client) ExperimentVariant(experimentVariant string) *Client

This parameter specifies that this user has been exposed to a particular variation of an experiment. It should be sent in conjunction with the Experiment ID parameter.

func (*Client) FlashVersion

func (h *Client) FlashVersion(flashVersion string) *Client

Specifies the flash version.

func (*Client) GeographicalOverride

func (h *Client) GeographicalOverride(geographicalOverride string) *Client

The geographical location of the user. The geographical ID should be a two letter country code or a criteria ID representing a city or region (see http://developers.google.com/analytics/devguides/collection/protocol/v1/geoid). This parameter takes precedent over any location derived from IP address, including the IP Override parameter. An invalid code will result in geographical dimensions to be set to '(not set)'.

func (*Client) GoogleAdWordsID

func (h *Client) GoogleAdWordsID(googleAdWordsID string) *Client

Specifies the Google AdWords Id.

func (*Client) GoogleDisplayAdsID

func (h *Client) GoogleDisplayAdsID(googleDisplayAdsID string) *Client

Specifies the Google Display Ads Id.

func (*Client) IPOverride

func (h *Client) IPOverride(iPOverride string) *Client

The IP address of the user. This should be a valid IP address in IPv4 or IPv6 format. It will always be anonymized just as though &aip (anonymize IP) had been used.

func (*Client) JavaEnabled

func (h *Client) JavaEnabled(javaEnabled bool) *Client

Specifies whether Java was enabled.

func (*Client) LinkID

func (h *Client) LinkID(linkID string) *Client

The ID of a clicked DOM element, used to disambiguate multiple links to the same URL in In-Page Analytics reports when Enhanced Link Attribution is enabled for the property.

func (*Client) ListIndex

func (h *Client) ListIndex(listIndex string) *Client

ListIndex is required by other properties

func (*Client) MetricIndex

func (h *Client) MetricIndex(metricIndex string) *Client

MetricIndex is required by other properties

func (*Client) NonInteractionHit

func (h *Client) NonInteractionHit(nonInteractionHit bool) *Client

Specifies that a hit be considered non-interactive.

func (*Client) ProductAction

func (h *Client) ProductAction(productAction string) *Client

The role of the products included in a hit. If a product action is not specified, all product definitions included with the hit will be ignored. Must be one of: detail, click, add, remove, checkout, checkout_option, purchase, refund. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductActionList

func (h *Client) ProductActionList(productActionList string) *Client

The list or collection from which a product action occurred. This is an additional parameter that can be sent when Product Action is set to 'detail' or 'click'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductBrand

func (h *Client) ProductBrand(productBrand string) *Client

The brand associated with the product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductCategory

func (h *Client) ProductCategory(productCategory string) *Client

The category to which the product belongs. Product index must be a positive integer between 1 and 200, inclusive. The product category parameter can be hierarchical. Use / as a delimiter to specify up to 5-levels of hierarchy. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductCouponCode

func (h *Client) ProductCouponCode(productCouponCode string) *Client

The coupon code associated with a product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductCustomDimension

func (h *Client) ProductCustomDimension(productCustomDimension string) *Client

A product-level custom dimension where dimension index is a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductCustomMetric

func (h *Client) ProductCustomMetric(productCustomMetric int64) *Client

A product-level custom metric where metric index is a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionBrand

func (h *Client) ProductImpressionBrand(productImpressionBrand string) *Client

The brand associated with the product. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionCategory

func (h *Client) ProductImpressionCategory(productImpressionCategory string) *Client

The category to which the product belongs. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionCustomDimension

func (h *Client) ProductImpressionCustomDimension(productImpressionCustomDimension string) *Client

A product-level custom dimension where dimension index is a positive integer between 1 and 200, inclusive. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionCustomMetric

func (h *Client) ProductImpressionCustomMetric(productImpressionCustomMetric int64) *Client

A product-level custom metric where metric index is a positive integer between 1 and 200, inclusive. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionListName

func (h *Client) ProductImpressionListName(productImpressionListName string) *Client

The list or collection to which a product belongs. Impression List index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionName

func (h *Client) ProductImpressionName(productImpressionName string) *Client

The name of the product. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionPosition

func (h *Client) ProductImpressionPosition(productImpressionPosition int64) *Client

The product's position in a list or collection. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionPrice

func (h *Client) ProductImpressionPrice(productImpressionPrice float64) *Client

The price of a product. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionSKU

func (h *Client) ProductImpressionSKU(productImpressionSKU string) *Client

The product ID or SKU. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductImpressionVariant

func (h *Client) ProductImpressionVariant(productImpressionVariant string) *Client

The variant of the product. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductIndex

func (h *Client) ProductIndex(productIndex string) *Client

ProductIndex is required by other properties

func (*Client) ProductName

func (h *Client) ProductName(productName string) *Client

The name of the product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductPosition

func (h *Client) ProductPosition(productPosition int64) *Client

The product's position in a list or collection. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductPrice

func (h *Client) ProductPrice(productPrice float64) *Client

The price of a product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductQuantity

func (h *Client) ProductQuantity(productQuantity int64) *Client

The quantity of a product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductSKU

func (h *Client) ProductSKU(productSKU string) *Client

The SKU of the product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProductVariant

func (h *Client) ProductVariant(productVariant string) *Client

The variant of the product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) PromoIndex

func (h *Client) PromoIndex(promoIndex string) *Client

PromoIndex is required by other properties

func (*Client) PromotionAction

func (h *Client) PromotionAction(promotionAction string) *Client

Specifies the role of the promotions included in a hit. If a promotion action is not specified, the default promotion action, 'view', is assumed. To measure a user click on a promotion set this to 'promo_click'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) PromotionCreative

func (h *Client) PromotionCreative(promotionCreative string) *Client

The creative associated with the promotion. Promotion index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) PromotionID

func (h *Client) PromotionID(promotionID string) *Client

The promotion ID. Promotion index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) PromotionName

func (h *Client) PromotionName(promotionName string) *Client

The name of the promotion. Promotion index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) PromotionPosition

func (h *Client) PromotionPosition(promotionPosition string) *Client

The position of the creative. Promotion index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ProtocolVersion

func (h *Client) ProtocolVersion(protocolVersion string) *Client

The Protocol version. The current value is '1'. This will only change when there are changes made that are not backwards compatible.

func (*Client) QueueTime

func (h *Client) QueueTime(queueTime int64) *Client

Used to collect offline / latent hits. The value represents the time delta (in milliseconds) between when the hit being reported occurred and the time the hit was sent. The value must be greater than or equal to 0. Values greater than four hours may lead to hits not being processed.

func (*Client) Revenue

func (h *Client) Revenue(revenue float64) *Client

The total value of the transaction, including tax and shipping. If not sent, this value will be automatically calculated using the product quantity and price fields of all products in the same hit. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) ScreenColors

func (h *Client) ScreenColors(screenColors string) *Client

Specifies the screen color depth.

func (*Client) ScreenName

func (h *Client) ScreenName(screenName string) *Client

If not specified, this will default to the unique URL of the page by either using the &dl parameter as-is or assembling it from &dh and &dp. App tracking makes use of this for the 'Screen Name' of the screenview hit.

func (*Client) ScreenResolution

func (h *Client) ScreenResolution(screenResolution string) *Client

Specifies the screen resolution.

func (*Client) Send

func (c *Client) Send(h hitType) error

func (*Client) SessionControl

func (h *Client) SessionControl(sessionControl string) *Client

Used to control the session duration. A value of 'start' forces a new session to start with this hit and 'end' forces the current session to end with this hit. All other values are ignored.

func (*Client) Shipping

func (h *Client) Shipping(shipping float64) *Client

The shipping cost associated with the transaction. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) Tax

func (h *Client) Tax(tax float64) *Client

The total tax associated with the transaction. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) TransactionID

func (h *Client) TransactionID(transactionID string) *Client

The transaction ID. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.

func (*Client) UserAgentOverride

func (h *Client) UserAgentOverride(userAgentOverride string) *Client

The User Agent of the browser. Note that Google has libraries to identify real user agents. Hand crafting your own agent could break at any time.

func (*Client) UserID

func (h *Client) UserID(userID string) *Client

This is intended to be a known identifier for a user provided by the site owner/tracking library user. It may not itself be PII (personally identifiable information). The value should never be persisted in GA cookies or other Analytics provided storage.

func (*Client) UserLanguage

func (h *Client) UserLanguage(userLanguage string) *Client

Specifies the language.

func (*Client) ViewportSize

func (h *Client) ViewportSize(viewportSize string) *Client

Specifies the viewable area of the browser / device.

type Event

type Event struct {
	// contains filtered or unexported fields
}

Event Hit Type

func NewEvent

func NewEvent(category string, action string) *Event

func (*Event) Copy

func (h *Event) Copy() *Event

func (*Event) Label

func (h *Event) Label(label string) *Event

Specifies the event label.

func (*Event) Value

func (h *Event) Value(value int64) *Event

Specifies the event value. Values must be non-negative.

type Exception

type Exception struct {
	// contains filtered or unexported fields
}

Exception Hit Type

func NewException

func NewException() *Exception

func (*Exception) Copy

func (h *Exception) Copy() *Exception

func (*Exception) Description

func (h *Exception) Description(description string) *Exception

Specifies the description of an exception.

func (*Exception) IsExceptionFatal

func (h *Exception) IsExceptionFatal(isExceptionFatal bool) *Exception

Specifies whether the exception was fatal.

type Item

type Item struct {
	// contains filtered or unexported fields
}

Item Hit Type

func NewItem

func NewItem(iD string, name string) *Item

func (*Item) Category

func (h *Item) Category(category string) *Item

Specifies the category that the item belongs to.

func (*Item) Code

func (h *Item) Code(code string) *Item

Specifies the SKU or item code.

func (*Item) Copy

func (h *Item) Copy() *Item

func (*Item) CurrencyCode

func (h *Item) CurrencyCode(currencyCode string) *Item

When present indicates the local currency for all transaction currency values. Value should be a valid ISO 4217 currency code.

func (*Item) Price

func (h *Item) Price(price float64) *Item

Specifies the price for a single item / unit.

func (*Item) Quantity

func (h *Item) Quantity(quantity int64) *Item

Specifies the number of items purchased.

type Pageview

type Pageview struct {
}

Pageview Hit Type

func NewPageview

func NewPageview() *Pageview

NewPageview creates a new Pageview Hit Type.

func (*Pageview) Copy

func (h *Pageview) Copy() *Pageview

type Screenview

type Screenview struct {
}

Screenview Hit Type

func NewScreenview

func NewScreenview() *Screenview

NewScreenview creates a new Screenview Hit Type.

func (*Screenview) Copy

func (h *Screenview) Copy() *Screenview

type Social

type Social struct {
	// contains filtered or unexported fields
}

Social Hit Type

func NewSocial

func NewSocial(network string, action string, actionTarget string) *Social

NewSocial creates a new Social Hit Type. Specifies the social network, for example Facebook or Google Plus. Specifies the social interaction action. For example on Google Plus when a user clicks the +1 button, the social action is 'plus'. Specifies the target of a social interaction. This value is typically a URL but can be any text.

func (*Social) Copy

func (h *Social) Copy() *Social

type Timing

type Timing struct {
	// contains filtered or unexported fields
}

Timing Hit Type

func NewTiming

func NewTiming() *Timing

func (*Timing) ContentLoadTime

func (h *Timing) ContentLoadTime(contentLoadTime int64) *Timing

Specifies the time it took for the DOMContentLoaded Event to fire. The value is in milliseconds.

func (*Timing) Copy

func (h *Timing) Copy() *Timing

func (*Timing) DNSTime

func (h *Timing) DNSTime(dNSTime int64) *Timing

Specifies the time it took to do a DNS lookup.The value is in milliseconds.

func (*Timing) DOMInteractiveTime

func (h *Timing) DOMInteractiveTime(dOMInteractiveTime int64) *Timing

Specifies the time it took for Document.readyState to be 'interactive'. The value is in milliseconds.

func (*Timing) PageDownloadTime

func (h *Timing) PageDownloadTime(pageDownloadTime int64) *Timing

Specifies the time it took for the page to be downloaded. The value is in milliseconds.

func (*Timing) PageLoadTime

func (h *Timing) PageLoadTime(pageLoadTime int64) *Timing

Specifies the time it took for a page to load. The value is in milliseconds.

func (*Timing) RedirectResponseTime

func (h *Timing) RedirectResponseTime(redirectResponseTime int64) *Timing

Specifies the time it took for any redirects to happen. The value is in milliseconds.

func (*Timing) ServerResponseTime

func (h *Timing) ServerResponseTime(serverResponseTime int64) *Timing

Specifies the time it took for the server to respond after the connect time. The value is in milliseconds.

func (*Timing) TCPConnectTime

func (h *Timing) TCPConnectTime(tCPConnectTime int64) *Timing

Specifies the time it took for a TCP connection to be made. The value is in milliseconds.

func (*Timing) UserTimingCategory

func (h *Timing) UserTimingCategory(userTimingCategory string) *Timing

Specifies the user timing category.

func (*Timing) UserTimingLabel

func (h *Timing) UserTimingLabel(userTimingLabel string) *Timing

Specifies the user timing label.

func (*Timing) UserTimingTime

func (h *Timing) UserTimingTime(userTimingTime int64) *Timing

Specifies the user timing value. The value is in milliseconds.

func (*Timing) UserTimingVariableName

func (h *Timing) UserTimingVariableName(userTimingVariableName string) *Timing

Specifies the user timing variable.

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

Transaction Hit Type

func NewTransaction

func NewTransaction(iD string) *Transaction

func (*Transaction) Affiliation

func (h *Transaction) Affiliation(affiliation string) *Transaction

Specifies the affiliation or store name.

func (*Transaction) Copy

func (h *Transaction) Copy() *Transaction

func (*Transaction) CurrencyCode

func (h *Transaction) CurrencyCode(currencyCode string) *Transaction

When present indicates the local currency for all transaction currency values. Value should be a valid ISO 4217 currency code.

func (*Transaction) Revenue

func (h *Transaction) Revenue(revenue float64) *Transaction

Specifies the total revenue associated with the transaction. This value should include any shipping or tax costs.

func (*Transaction) Shipping

func (h *Transaction) Shipping(shipping float64) *Transaction

Specifies the total shipping cost of the transaction.

func (*Transaction) Tax

func (h *Transaction) Tax(tax float64) *Transaction

Specifies the total tax of the transaction.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL