Permalink
Browse files

Updated code

  • Loading branch information...
coldfumonkeh committed Jul 10, 2013
1 parent 0ed7707 commit b808874fbd01feaec72ad7341b52e68119d694d5
Showing with 10 additions and 29 deletions.
  1. +1 −0 .gitignore
  2. +4 −4 Application.cfc
  3. +5 −25 index.cfm
@@ -1,3 +1,4 @@
.project
.settings
unit_tests/*
test.cfm
@@ -12,17 +12,17 @@
hint="Fires when the application is first created.">

<cfset application.objGA = new com.coldfumonkeh.GoogleAnalytics(
client_id = '772265743439-58s3t34rhj9boqfrqscka0q525fg8pdc.apps.googleusercontent.com',
client_secret = 'oPOIFjXdr7KcSdwLMWhvJQyM',
client_id = '< your client id >',
client_secret = '< your client secret >',
redirect_uri = 'http://127.0.0.1:8500/googleanalytics/index.cfm',
readonly = false,
state = '',
access_type = 'offline',
approval_prompt = 'force'
) />

<cfset application.objGA.setAccess_token('ya29.AHES6ZTwGq_nIMqiVsUQWmEgQtvBgA7ajPMz4XZ6H9-EPFc') />
<cfset application.objGA.setRefresh_token('1/bk_imqDTVpELFWHvyRcqHRe-9Y2I83Pt25lymozGf0M') />
<cfset application.objGA.setAccess_token('< your access token >') />
<cfset application.objGA.setRefresh_token('< your refresh token >') />

<cfreturn true />
</cffunction>
@@ -1,11 +1,4 @@
<cfset application.objGA.refreshToken()>
<!---<cfdump var="#application.objGA.listWebProperties(accountid="37540125")#">--->

<cfdump var="#application.objGA.queryAnalytics(
profileID = "67782753"
)#">

<!---<!---<cfif structKeyExists(URL, 'code')>
<cfif structKeyExists(URL, 'code')>
<!---
We have the code from the authentication,
so let's obtain the access token.
@@ -27,15 +20,14 @@
</cfif>

</cfif>
--->
<!---
If the SESSION key exists, we seem to have access to the API.
--->
<!---<cfif structKeyExists(session, "google_api_auth")>
<cfif structKeyExists(session, "google_api_auth")>

<a href="revoke.cfm">Revoke API Access</a>

<a href="index.cfm?reinit=true">Reload</a>--->
<a href="index.cfm?reinit=true">Reload</a>

<cfdump var="#application.objGA#">

@@ -64,16 +56,6 @@

<!---<cfset stuData = application.objGA.getProfiles() />--->

<cfset stuData = application.objGA.getExperiment(
accountID = "37540125",
webPropertyID = "UA-37540125-2",
profileID = "67782753",
experimentID = "3MchIzT7RomxjaKn-wuxcA"
) />
<cfdump var="#stuData#">
<!---<cfdump var="#application.objGA.listDailyUploads(
accountId = "37540125",
webPropertyId = "UA-37540125-2",
@@ -103,14 +85,12 @@
<cfdump var="#stuData#">--->

<!---<cfelse>
<cfelse>

<!---
We are not logged in or authenticated.
Let's do that now so that the user can access the Analytics data.
--->
<cfoutput><a href="#application.objGA.getLoginURL()#">Login and Authenticate</a></cfoutput>

</cfif>--->
<cfdump var="#application.objGA#">--->
</cfif>

0 comments on commit b808874

Please sign in to comment.