DevilsApprentice
07-08-2008, 07:46 AM
I'm really struggling to get the tracking code for a conversion page right in Analytics.
I have a php page that is basically a form and on validation and sending of the form it inserts the analytics conversion code. The initial problem was that on completion of the form it doesn't go to a new URL.
I found some stuff on this in the help section and I have managed to come up with this but it still doesn't track it as a goal.
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview("/completed-application.html");
</script>
The _trackPageview part is meant to tell analytics to consider the page to be called 'completed-application.html' so that it can appear as a separate page for goal tracking purposes (as far as I understand and can be found at http://www.google.com/support/analytics/bin/answer.py?answer=55576
Anyone able to see where I am going wrong with this?
I have a php page that is basically a form and on validation and sending of the form it inserts the analytics conversion code. The initial problem was that on completion of the form it doesn't go to a new URL.
I found some stuff on this in the help section and I have managed to come up with this but it still doesn't track it as a goal.
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview("/completed-application.html");
</script>
The _trackPageview part is meant to tell analytics to consider the page to be called 'completed-application.html' so that it can appear as a separate page for goal tracking purposes (as far as I understand and can be found at http://www.google.com/support/analytics/bin/answer.py?answer=55576
Anyone able to see where I am going wrong with this?