Link to home
Start Free TrialLog in
Avatar of Jon Imms
Jon ImmsFlag for United States of America

asked on

Gravity Forms submission tracking.

I am trying to add some javascript tracking code to a gravity forms submission.

I would like the following to be added to the submit button :

      <script type="text/javascript">
   window._pq = window._pq || [];
   _pq.push(['track', 'Appcomplete']);
</script>

I know i have to use the gform_after_submission hook below,  but i'm not sure how i would add a javascript script into a php function?

add_action( 'gform_after_submission_1', 'after_submission', 10, 2);
function after_submission() {

}
Avatar of James Rodgers
James Rodgers
Flag of Canada image

i think this is more what you are looking for

https://www.gravityhelp.com/documentation/article/gform_post_render/

but the code you provided is not bound to a submit action, it is executed as the page loads, it doesn't need o be bound to a form submit action, just place it on the page in the footer
Avatar of Jon Imms

ASKER

From what i'm being told,  this is bound when the submit button is clicked.
http://support.perfectaudience.com/knowledgebase/articles/212490-segmenting-api

    <script type="text/javascript">
   window._pq = window._pq || [];
   _pq.push(['track', 'Appcomplete']);
</script>
ASKER CERTIFIED SOLUTION
Avatar of James Rodgers
James Rodgers
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial