Rich-text Reply

Custom Event Goal - firing JS from within Pardot Form

pkuhn 07-31-15

Custom Event Goal - firing JS from within Pardot Form

Hey Optiverse!

 

I am trying to run an experiment on a page on my site, which has a Pardot form embedded via Iframe. 

 

In Pardot, I can add custom JS to fire upon submission - for instance we could fire GA code, or launch a window for an asset download. 

 

What I want to do is add an Optimizely "custom event" snippet - so when the form is completed, Optimizely is altered by this event, and my goal (which is this event) is logged.

 

I have the following code:

var trackCustomEvent = function() {   
window['optimizely'] = window['optimizely'] || [];
window['optimizely'].push(["trackEvent", "ControlRiskConf"]);

 

Which seems to run, however, my Experiment doesn't seem to log the goal.  

 

Is it because my code is run in an Iframe? The URL (https://go.pardot.com/xxx/xxx ) of the Iframe differs from my corporate domain (http://www.globalscape.com).. 

 

And if this idea "can't" work - I'm very open to suggestions that would work! I just need to track this form conversion.. Many thanks. 

 

pete

Level 2

pkuhn 07-31-15
 

Re: Custom Event Goal - firing JS from within Pardot Form

oh.. did the Cross domain cookie issue get me? https://help.optimizely.com/hc/en-us/articles/201367204
Level 2
Amanda 07-31-15
 

Re: Custom Event Goal - firing JS from within Pardot Form

Yep - you hit the nail on the head. Cross domain goal tracking is tricky and would definitely cause the issue you referenced in the initial post. That article you linked above does describe a workaround if you have the dev resources and control over the second domain to be able to implement something like that.

Does this help?
Optimizely
pkuhn 07-31-15
 

Re: Custom Event Goal - firing JS from within Pardot Form

Thanks Amanda, 

 

The KB article helps but.. out corporate domain is not secure while the iFrame is - so loading it inside the iFrame would cause security warnings. UGH. 

 

 

 

Level 2