Welcome to WebmasterWorld Guest from 54.146.206.127

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

Tracking Logged In Users

Super simple way?

     
9:39 pm on Mar 30, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Mar 7, 2003
posts: 1085
votes: 10


Working with an old site built in Cold Fusion that requires a user to login to take tests.

The site is super simple in that the URL doesn't change after a user logs in.

(yeah, I smell all kinds of problems associated with this and we're slowly getting there...)

but here's the simple question - the only difference between a logged in user and a non-logged in user is the word "Log in" is changed to "Logged in".

Is there a way to write a simple filter in Google Analytics to track occurrences of pages that contain the word "logged"?

Or is there a more simple way to do it (besides throwing out Cold Fusion and starting all over again!)

-as always, THANKS in advance for any insight you can offer.
5:23 pm on Mar 31, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:June 20, 2006
posts:2077
votes: 63


I always see custom vars used, explained well here:
[dbi.io...]

If using a Tag Manager, also see here:
[moz.com...]
4:05 pm on Apr 6, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Mar 7, 2003
posts: 1085
votes: 10


Thanks RF - very helpful - I understand this enough to know how much I DON'T know as I'm quite out of my depth with Cold Fusion!
2:38 pm on May 26, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2004
posts:1970
votes: 68


If it is an old side I would assume it is CFML

logged_in(or what ever the name of the variable that controls that state of the logged-in) must be either a client or a session variable, so when the user logs in you need to set it to 1:
<cfparam name ="logged_in_ind" default="0">
<cfif isDefined("client.logged_in") and client.logged_in>
<cfset logged_in_ind = 1>
<cfelseif isDefined("session.logged_in") and session.logged_in>
<cfset logged_in_ind = 1>
</cfif>

<cfif logged_in_ind>
<script type=”text/javascript”>
_gaq.push([‘_setCustomVar’, 1, ‘status’, ‘logged_in’, <cfoutput>#logged_in_ind#</cfoutput>]);
</script>
</cfif>


then you do your [dbi.io...] stuff.



There might be better ways of doing it, but that is a skeleton of it.
LOVE ColdFusion!