Rich-text Reply

Pushing Opmizely experiment goals through variation code

codebreak 05-17-16
Accepted Solution

Pushing Opmizely experiment goals through variation code

I have ben trying to use experiment goal tracking in optimizely to track when a form is submitted and has no error. The problem I am having is there appears to be nothing going through to Optimizely. I have verified via the log and console windows that the experiment is loaded which is it. The problem is when looking through the network requests nothing ever hits optimizely to so I know the events are not pushing to optimizely.

 

What I have found is this code below returns "undefined" on the console:

window.optimizely.push(["trackEvent","mygoal"]);

 

I currently have prototype and jQuery loaded in compatability mode.

 

Here is what I see when I view the log:

 

Optimizely / Main / Started, revision 531 [time 0 +0] 3048750167.js:175:302
Optimizely / Query / Blocked request to load unsafe script: null [time 5 +5] 3048750167.js:175:302
Optimizely / Segmenter / Loading segments cookie. [time 7 +2] 3048750167.js:175:302
Optimizely / Segmenter / Segments cookie contains segment id: 3046380708 [time 7 +0] 3048750167.js:175:302
Optimizely / Segmenter / Segments cookie contains segment id: 3055080056 [time 7 +0] 3048750167.js:175:302
Optimizely / Segmenter / Segments cookie contains segment id: 3063300114 [time 7 +0] 3048750167.js:175:302
Optimizely / Segmenter / Segments cookie contains segment id: 3174540302 [time 7 +0] 3048750167.js:175:302
Optimizely / Activator / Triaging 4 segments. [time 7 +0] 3048750167.js:175:302
Optimizely / Condition / Testing segment 3046380708 [time 7 +0] 3048750167.js:175:302
Optimizely / Activator / Passed conditions for segment 3046380708 [time 7 +0] 3048750167.js:175:302
Optimizely / Condition / Testing segment 3055080056 [time 7 +0] 3048750167.js:175:302
Optimizely / Activator / Passed conditions for segment 3055080056 [time 7 +0] 3048750167.js:175:302
Optimizely / Condition / Testing segment 3063300114 [time 7 +0] 3048750167.js:175:302
Optimizely / Activator / Passed conditions for segment 3063300114 [time 7 +0] 3048750167.js:175:302
Optimizely / Condition / Testing segment 3174540302 [time 7 +0] 3048750167.js:175:302
Optimizely / Activator / Passed conditions for segment 3174540302 [time 7 +0] 3048750167.js:175:302
Optimizely / Segmenter / Evaluating Segment 3046380708 [time 7 +0] 3048750167.js:175:302
Optimizely / Segmenter / Evaluating Segment 3055080056 [time 8 +1] 3048750167.js:175:302
Optimizely / Segmenter / Evaluating Segment 3063300114 [time 8 +0] 3048750167.js:175:302
Optimizely / Segmenter / Evaluating Segment 3174540302 [time 8 +0] 3048750167.js:175:302
Optimizely / Integrator / Loading third-party segments. [time 9 +1] 3048750167.js:175:302
Optimizely / Visitor / Initializing [time 9 +0] 3048750167.js:175:302
Optimizely / Visitor / Found segment 3046380708 [time 10 +1] 3048750167.js:175:302
Optimizely / Visitor / Found segment 3055080056 [time 10 +0] 3048750167.js:175:302
Optimizely / Visitor / Found segment 3063300114 [time 10 +0] 3048750167.js:175:302
Optimizely / Visitor / Found segment 3174540302 [time 10 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 5851411517 [time 13 +3] 3048750167.js:175:302
Optimizely / Condition / Testing audiences for experiment 5851411517: 3224640867 [time 13 +0] 3048750167.js:175:302
Optimizely / Visitor / Got dimension (device) value 3210542314: {"id":"unknown","type":"desktop","v":false} [time 13 +0] 3048750167.js:175:302
Optimizely / Visitor / Checking if in audience 3224640867: true [time 13 +0] 3048750167.js:175:302
Optimizely / Condition / Testing URLs for experiment 5851411517 [time 13 +0] 3048750167.js:175:302
Optimizely / Condition / Failed to match any URL for experiment 5851411517 [time 14 +1] 3048750167.js:175:302
Optimizely / Activator / Triaging 1 experiments. [time 14 +0] 3048750167.js:175:302
Optimizely / Activator / Force-ignoring conditions for experiment 5851411517 [time 14 +0] 3048750167.js:175:302
Optimizely / Distributor / Not distributing experiment 5851411517 (already in plan) [time 14 +0] 3048750167.js:175:302
Optimizely / Evaluator / 0 times waited [time 15 +1] 3048750167.js:175:302
Optimizely / Evaluator / 1 steps remaining [time 15 +0] 3048750167.js:175:302
Optimizely / Evaluator / Document not ready yet [time 15 +0] 3048750167.js:175:302
Optimizely / Info / Is enabled: true [time 16 +1] 3048750167.js:175:302
Optimizely / Info / Diagnostic enabled: false [time 16 +0] 3048750167.js:175:302
Optimizely / Info / Force variation enabled: true [time 16 +0] 3048750167.js:175:302
Optimizely / Info / Script to load: none [time 16 +0] 3048750167.js:175:302
Optimizely / Info / Browser type: ff [time 16 +0] 3048750167.js:175:302
Optimizely / Info / Browser version: 45.0 [time 16 +0] 3048750167.js:175:302
Optimizely / Info / New vs returning: returning [time 16 +0] 3048750167.js:175:302
Optimizely / Info / Source type: null [time 16 +0] 3048750167.js:175:302
Optimizely / Info / User ID: oeu1463519029643r0.695901726385765 [time 16 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3067060272 [time 16 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3067060272 (paused) [time 16 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3221941109 [time 16 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3221941109 (paused) [time 16 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3248840373 [time 16 +0] 3048750167.js:175:302
Optimizely / Condition / Testing audiences for experiment 3248840373: 3256100852 [time 16 +0] 3048750167.js:175:302
Optimizely / Visitor / Got dimension (source_type) value 3259260388: "direct" [time 20 +4] 3048750167.js:175:302
Optimizely / Visitor / Checking if in audience 3256100852: false [time 20 +0] 3048750167.js:175:302
Optimizely / Condition / Failed to match any audiences for experiment 3248840373 [time 20 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3315620201 [time 20 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3315620201 (paused) [time 20 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3320481326 [time 20 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3320481326 (paused) [time 20 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3321550278 [time 20 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3321550278 (paused) [time 20 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3327090115 [time 21 +1] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3327090115 (paused) [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3352620159 [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3352620159 (paused) [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3472040632 [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3472040632 (paused) [time 21 +0] 3048750167.js:175:302
Optimizely / Distributor / Configuring conditionally-activated experiment: 3530220948 [time 21 +0] 3048750167.js:175:302
Optimizely / Distributor / Not configuring conditionally-activated experiment (not enabled): 3530220948 [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3532350458 [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3532350458 (paused) [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3708800922 [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3708800922 (paused) [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 3869314546 [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Failed for experiment 3869314546 (paused) [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 4869313066 [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Testing audiences for experiment 4869313066: 4884410918 [time 21 +0] 3048750167.js:175:302
Optimizely / Visitor / Got dimension (device) value 3210542314: {"id":"unknown","type":"desktop","v":false} [time 21 +0] 3048750167.js:175:302
Optimizely / Visitor / Checking if in audience 4884410918: false [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Failed to match any audiences for experiment 4869313066 [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 5272131057 [time 21 +0] 3048750167.js:175:302
Optimizely / Condition / Testing audiences for experiment 5272131057: 3224640867 [time 21 +0] 3048750167.js:175:302
Optimizely / Visitor / Got dimension (device) value 3210542314: {"id":"unknown","type":"desktop","v":false} [time 21 +0] 3048750167.js:175:302
Optimizely / Visitor / Checking if in audience 3224640867: true [time 22 +1] 3048750167.js:175:302
Optimizely / Condition / Testing URLs for experiment 5272131057 [time 22 +0] 3048750167.js:175:302
Optimizely / Condition / Failed to match any URL for experiment 5272131057 [time 22 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 5803870434 [time 22 +0] 3048750167.js:175:302
Optimizely / Condition / Testing URLs for experiment 5803870434 [time 22 +0] 3048750167.js:175:302
Optimizely / Condition / Failed to match any URL for experiment 5803870434 [time 22 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 5873661043 [time 22 +0] 3048750167.js:175:302
Optimizely / Condition / Testing URLs for experiment 5873661043 [time 22 +0] 3048750167.js:175:302
Optimizely / Condition / Failed to match any URL for experiment 5873661043 [time 22 +0] 3048750167.js:175:302
Optimizely / Condition / Testing experiment 5851411517 [time 22 +0] 3048750167.js:175:302
Optimizely / Condition / Testing audiences for experiment 5851411517: 3224640867 [time 22 +0] 3048750167.js:175:302
Optimizely / Visitor / Got dimension (device) value 3210542314: {"id":"unknown","type":"desktop","v":false} [time 22 +0] 3048750167.js:175:302
Optimizely / Visitor / Got dimension (device) value 3210542314: {"id":"unknown","type":"desktop","v":false} [time 23 +1] 3048750167.js:175:302
Optimizely / Visitor / Got dimension (device) value 3210542314: {"id":"unknown","type":"desktop","v":false} [time 23 +0] 3048750167.js:175:302
Optimizely / Visitor / Checking if in audience 3224640867: true [time 23 +0] 3048750167.js:175:302
Optimizely / Condition / Testing URLs for experiment 5851411517 [time 23 +0] 3048750167.js:175:302
Optimizely / Condition / Failed to match any URL for experiment 5851411517 [time 23 +0] 3048750167.js:175:302
Optimizely / Evaluator / 1 times waited [time 25 +2] 3048750167.js:175:302
Optimizely / Evaluator / 1 steps remaining [time 25 +0] 3048750167.js:175:302
Optimizely / Evaluator / Document not ready yet [time 25 +0] 3048750167.js:175:302
Optimizely / API / Finalizing API. [time 25 +0] 3048750167.js:175:302
Optimizely / Main / End of main [time 27 +2] 3048750167.js:175:302
Optimizely / Evaluator / 2 times waited [time 100 +73] 3048750167.js:175:302
Optimizely / Evaluator / 1 steps remaining [time 100 +0] 3048750167.js:175:302
Optimizely / Evaluator / Document not ready yet [time 100 +0] 3048750167.js:175:302
Optimizely / Evaluator / 3 times waited [time 100 +0] 3048750167.js:175:302
Optimizely / Evaluator / 1 steps remaining [time 100 +0] 3048750167.js:175:302
Optimizely / Evaluator / Document not ready yet [time 101 +1] 3048750167.js:175:302
Optimizely / Evaluator / 4 times waited [time 236 +135] 3048750167.js:175:302
Optimizely / Evaluator / 1 steps remaining [time 236 +0] 3048750167.js:175:302
Optimizely / Evaluator / Document not ready yet [time 236 +0] 3048750167.js:175:302
Optimizely / Evaluator / 5 times waited [time 236 +0] 3048750167.js:175:302
Optimizely / Evaluator / 1 steps remaining [time 236 +0] 3048750167.js:175:302
Optimizely / Evaluator / Document not ready yet [time 236 +0] 3048750167.js:175:302
Optimizely / Evaluator / Document is ready [time 236 +0] 3048750167.js:175:302
Optimizely / Evaluator / 6 times waited [time 236 +0] 3048750167.js:175:302
Optimizely / Evaluator / 1 steps remaining [time 236 +0] 3048750167.js:175:302
Optimizely / Evaluator / Run code: sliderId = 14;
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent","state2"]); [time 236 +0] 3048750167.js:175:302
Optimizely / API / Called function "trackEvent" [time 236 +0] 3048750167.js:175:302
Optimizely / Evaluator / 6 total times waited [time 237 +1] 3048750167.js:175:302
Optimizely / API / Called function "activateUniversalAnalytics" [time 312 +75] 3048750167.js:175:302
Optimizely / Evaluator / 6 times waited [time 415 +103] 3048750167.js:175:302
Optimizely / Evaluator / 6 total times waited [time 415 +0] 3048750167.js:175:302
Optimizely / Activator / Timeout: will not act on future async info. [time 2040 +1625] 3048750167.js:175:302
Optimizely / API / Called function "trackEvent" [time 14444 +12404] 3048750167.js:175:302
Optimizely / API / Called function "log" [time 800090 +785646] 3048750167.js:175:302
unreachable code after return statement

 

Is this likely a conflict with something on my page?

 

Would it be better to implement the event on a empty page and test that way?

codebreak 05-17-16
 

Re: Pushing Opmizely experiment goals through variation code

I think I figured it out. When I disable the force experiment parameter IE: "optimizely_x1111111111xxxx=1" the goal fires! Is this an intended feature?

robertchan 05-18-16
 

Re: Pushing Opmizely experiment goals through variation code

I think you should also try to attached forced tracking to your experiment like so: optimizely_x1111111111xxxx=1&optimizely_force_tracking=true

By doing that, you'd be able to go to your network tab, filter by XHR and also check that the N value corresponds to the event you expect to fire.
Robert Chan

Experimentation Hero