Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cmmclaug
Visitor

Omniture integration with RSG_Analytics failing

Omniture integration with RSG_Analytics failing:

Thanks in advance for any assistance!

I'm attempting to add Omniture tracking into my app using the Roku Analytics component as described in the sdk here:
https://sdkdocs.roku.com/display/sdkdoc ... +Component

Following the sdk and the sample channels, I was able to initiate an analytics node and send a number of properly formatted trackEvents() with the debug flag on using a dummy baseUrl. Unfortunately, after I switched to the real baseUrl which returned header information to parse, the header parsing called the validStr() function which is not defined in the Roku Analytics node scope. The runtime threw a function call operator runtime error and crashed as shown below, and I'm not sure how to fix this as this is all internal to the Roku Analytics library...

Device: 3600X, Firmware version: 8.10 build 4145

 sub NWM_OMNITURE_ProcessMessages()
125:    while true
126:      msg = m.port.GetMessage()
127:      if msg = invalid
128:        exit while
129:      end if
130:      if m.debug then ? "NWM_Omniture: got " + type(msg)
131:      
132:      if type(msg) = "roUrlEvent" ' should always be true
133:        headers = msg.GetResponseHeadersArray()
134:        for each header in headers
135:          if header.DoesExist("set-cookie")
136:*           cookies = ValidStr(header.Lookup("set-cookie"))
137:            rx = Createobject("roRegEx", "(s_vi=.*?);", "")
138:            matches = rx.Match(cookies)
139:            if matches.Count() > 1
140:              m.cookie = matches[1]
141:              if m.debug then ? "NWM_Omniture: found cookie " + m.cookie
142:              exit for
143:            end if
144:          end if
145:        next
146:      end if
147:    end while
148:  end sub

Function Call Operator ( ) attempted on non-function. (runtime error &he0) in /tmp/plugin/PCAAAACt86sB/pkg:/components/libs/NWM_Omniture.brs(136)
136: ??
Backtrace:
#6  Function nwm_omniture_processmessages() As Void
   file/line: /tmp/plugin/PCAAAACt86sB/pkg:/components/libs/NWM_Omniture.brs(136)
#5  Function nwm_omniture_logevent(params As Dynamic) As Dynamic
   file/line: /tmp/plugin/PCAAAACt86sB/pkg:/components/libs/NWM_Omniture.brs(76)
#4  Function omniture_eventhandler(params As Dynamic) As Object
   file/line: /tmp/plugin/PCAAAACt86sB/pkg:/components/handlers/Omniture.brs(42)
#3  Function roku_analytics_component__callfunction(analyticid As String, functionname As String, value As Object) As Void
   file/line: /tmp/plugin/PCAAAACt86sB/pkg:/components/AnalyticsNode.brs(328)
#2  Function roku_analytics_component__ontrackevent(params As Dynamic, node As Dynamic) As Dynamic
   file/line: /tmp/plugin/PCAAAACt86sB/pkg:/components/AnalyticsNode.brs(205)
#1  Function analytics_utils__processregisterednodecallback(event As Object) As Void
   file/line: /tmp/plugin/PCAAAACt86sB/pkg:/components/AnalyticsUtils.brs(288)
#0  Function analyticsnode_eventhandler() As Void
   file/line: /tmp/plugin/PCAAAACt86sB/pkg:/components/AnalyticsNode.brs(154)
Local Variables:
global           Interface:ifGlobal
m                roAssociativeArray refcnt=5 count:9
msg              bsc:roUrlEvent refcnt=1
headers          roArray refcnt=3 count:33
header           roAssociativeArray refcnt=2 count:1
cookies          <uninitialized>
rx               <uninitialized>
matches          <uninitialized>
validstr         <uninitialized>
Threads:
ID    Location                                Source Code
 0 pkg:/source/main.brs(15)                screen.show()
 2*   ...ponents/libs/NWM_Omniture.brs(136)   ??
  *selected   unattached(not debuggable)

Thanks again.
0 Kudos
5 REPLIES 5

Re: Omniture integration with RSG_Analytics failing

I am getting the same error on the same line.
0 Kudos

Re: Omniture integration with RSG_Analytics failing

I believe this is a bug. I have seen validstr referenced in other brs util code, but it appears to be undefined in the roku_analytics lib, so I'm guessing that this use of validstr was accidentally left in. Analytics requests that do not return set-cookie headers are fine, but any that do fail on this line.
0 Kudos
NB_
Roku Guru

Re: Omniture integration with RSG_Analytics failing

seems like a bug, yes. i'll escalate it, thanks for bringing it up
0 Kudos
NB_
Roku Guru

Re: Omniture integration with RSG_Analytics failing

This will be fixed in v1.2 of Roku Analytics Component, soon to be out
0 Kudos
taschmidt
Streaming Star

Re: Omniture integration with RSG_Analytics failing

@cmmclaug can I ask how the heck you managed to get at the source for the analytics component? We're having troubles and Roku's support leaves a lot to be desired!
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.