Last active
April 21, 2017 20:16
-
-
Save brucemcpherson/7453196 to your computer and use it in GitHub Desktop.
universal analytics measurement functions and parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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