Skip to content

Commit

Permalink
Updated to use new tracking ID closes #2788
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed Aug 11, 2015
1 parent b60c229 commit d802f56
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
20 changes: 17 additions & 3 deletions src/github.com/getlantern/analytics/analytics.go
Expand Up @@ -3,6 +3,7 @@ package analytics
import (
"bytes"
"net/http"
"net/http/httputil"
"net/url"
"runtime"
"strconv"
Expand Down Expand Up @@ -77,7 +78,11 @@ func Configure(trackingId string, version string, proxyAddr string) {
return
}
// Store new session info whenever client proxy is ready
sessionEvent(trackingId, version)
if status, err := sessionEvent(trackingId, version); err != nil {
log.Errorf("Unable to store new session info: %v", err)
} else {
log.Tracef("Storing new session info: %v", status)
}
}()
}

Expand Down Expand Up @@ -147,14 +152,23 @@ func SendRequest(payload *Payload) (status bool, err error) {
r.Header.Add("Content-Type", "application/x-www-form-urlencoded")
r.Header.Add("Content-Length", strconv.Itoa(len(args)))

if req, err := httputil.DumpRequestOut(r, true); err != nil {
log.Debugf("Could not dump request: %v", err)
} else {
log.Debugf("Full analytics request: %v", string(req))
}

resp, err := httpClient.Do(r)
if err != nil {
log.Errorf("Could not send HTTP request to GA: %s", err)
return false, err
}
log.Debugf("Successfully sent request to GA: %s", resp.Status)
defer resp.Body.Close()

defer func() {
if err := resp.Body.Close(); err != nil {
log.Debugf("Unable to close response body: %v", err)
}
}()
return true, nil
}

Expand Down
Expand Up @@ -13,7 +13,7 @@ import (

const (
messageType = `Analytics`
TrackingId = "UA-21815217-2"
TrackingId = "UA-21815217-12"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion src/github.com/getlantern/lantern-ui/app/js/constants.js
Expand Up @@ -35,7 +35,7 @@ var DEFAULT_LANG = 'en_US',
es: {dir: 'ltr', name: 'español'},
ar: {dir: 'rtl', name: 'العربية'}
},
GOOGLE_ANALYTICS_WEBPROP_ID = 'UA-21815217-2',
GOOGLE_ANALYTICS_WEBPROP_ID = 'UA-21815217-12',
GOOGLE_ANALYTICS_DISABLE_KEY = 'ga-disable-'+GOOGLE_ANALYTICS_WEBPROP_ID,
loc = typeof location == 'object' ? location : undefined,
// this allows the real backend to mount the entire app under a random path
Expand Down

0 comments on commit d802f56

Please sign in to comment.