Skip to content

Instantly share code, notes, and snippets.

@brucemcpherson
Last active April 21, 2017 20:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brucemcpherson/7453196 to your computer and use it in GitHub Desktop.
Save brucemcpherson/7453196 to your computer and use it in GitHub Desktop.
universal analytics measurement functions and parameters
'gistThat@mcpher.com :do not modify this line - see ramblings.mcpher.com for details: updated on 3/4/2014 2:17:37 PM : from manifest:7471153 gist https://gist.github.com/brucemcpherson/7453196/raw/UAMeasure.vba
Option Explicit
Public Sub testua()
With registerUA("developing_testua")
' do something
sleep 5
' kill session
.postAppKill
If Not .browser.isOk Then
Debug.Print .browser.status
End If
.tearDown
End With
End Sub
Public Function registerUA(page As String) As cUAMeasure
Dim c As cUAMeasure
Set c = New cUAMeasure
With c
.postAppView (page)
' silent fail
If Not .browser.isOk Then
Debug.Print .browser.status
End If
End With
Set registerUA = c
End Function
Public Function getUACode() As String
getUACode = "UA-45711027-1"
End Function
Public Function getVersion() As String
getVersion = "cDataSet.v.3.012"
End Function
Public Function getUserHash() As String
getUserHash = encryptSha1(getSalt(), _
Application.ThisWorkbook.FullName & Application.UserName)
End Function
Public Function getSalt() As String
getSalt = "vNIXE0xscrmjlyV-12Nj_BvUPaw="
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment