PDA

View Full Version : Google Analytics Conversion Code


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?

AussieWebmaster
07-08-2008, 12:16 PM
did you fill in the UA with your account number

DevilsApprentice
07-08-2008, 12:51 PM
did you fill in the UA with your account number

I know its something that needs checking but yes I did :)

seomike
07-08-2008, 01:49 PM
make sure your script source is from
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">
</script>
if your conversion page is https://

DevilsApprentice
07-09-2008, 05:23 AM
make sure your script source is from
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">
</script>
if your conversion page is https://

Unfortunately it isn't https - will be next week so I'll keep that in mind when changing.