Enable analytics in Director PLEASE HELP

Hi. I’m using director class in my game and i want to enable analytics for beta testers

What can i do to enable it across entire game?

This is enough?:

local appKey = "XXX"  
require "analytics"  
analytics.init(appKey)  

and use analytics.logEvent(“anything”) in any lua page

Or we require (like with gameNetwork) this?:

local appKey = "XXX"  
\_G.analytics = require "analytics"  
\_G.analytics.init(appKey)  

and use _G.analytics.logEvent(“anything”)

Thanks for your response [import]uid: 55808 topic_id: 17565 reply_id: 317565[/import]