var userID = jive.global._jive_effective_user_id;
This very topic, and the ability to push user data into a service like Google Analytics, is something I have been looking into recently for our own Jive Knowledge Base. It would be worth posting over in Ideas for Jive requesting more functionality around what data can be referenced through third-party analytics - I suspect there are other community members who would also be interested in this.
One note that I came across last year during my research was that there is a cookie present that holds information around whether someone is logged in. The cookie's name is "jive.user.loggedIn", which will be set to true if the user is logged in. I expect your developer may be able to check to see if this cookie is set to true and can push that out to GA.
Thanks, David – I appreciate your response. I can virtually guarantee you that all Jive customers would like more ACCESS to the third party analytics via the admin console (like it used to be) and also more FUNCTIONALITY around it. Giving customers back their access to TPA thru the console is well documented in a couple different areas of the Jive customer community.
Ronan has tried your below suggestion, and can better speak to the results. He will follow up with you I believe.
Can the footer access the Jive API?
Could I do something like:
var userID = '/api/core/v3/people/@me';
var placeid = 'https://communities.mentor.com/api/core/v3/places/placeID';
Then use userID and placeID in our GA script?
Looking back at the variable found in the link Gordon posted, I think we can find the "_jive_effective_user_id" object in the "window" variable now instead of "jive.global". Example:
var userID = window._jive_effective_user_id
var placeid = jive.global.containerID
You also should keep in mind that the "container ID" is not unique to all places. For example, you may have a Project with a Container ID of 1000, and a Social Group with a container ID of 1000. Because of this, it may be best to combine both the Container ID and the Container Type, so that each Place in jive has a unique ID in your Google Analytics system. You could try something like this:
var containerString = jive.global.containerType.toString() + ':' + jive.global.containerID.toString();
This is what we're doing in the Knowledge Base today and is touched on in Knowledge Base Implementation Guide
Hello David Bastedo,
So here's what I've learned (what I've known for a while):
var userID = window._jive_effective_user_id does not work when placed in the footer.
var userID = window._jive_effective_user_id returns an "undefined" error when placed in a HTML widget.
var userID = window.parent._jive_effective_user_id returns the correct result when placed in a HTML widget.
So do you have any idea why window.parent works in the HTML widget but not in the page footer?
I'm not entirely sure Ronan, although I suspect it may have something to do with widget contents being in iframes.