cstamper
New Member
- Messages
- 126
- Reaction score
- 0
- Points
- 0
I'm trying to get the legacy Google Analytics tracking code into my PHP webpage. Fwiw, I'm using pluck-cms.
The code is supposed to look like this (HTML):
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-thisismycode";
urchinTracker();
</script>
So my PHP looks like this:
echo "<script src=\"http://www.google-analytics.com/urchin.js\" type=\"text/javascript\">";
echo "</script>";
echo "<script type=\"text/javascript">";
echo "_uacct = \"UA-thisismycode";";
echo "urchinTracker();"
echo "</script>";
Which works, until it reaches this line:
echo "_uacct = \"UA-thisismycode";";
It gives this error when I load the page in a browser:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in ---------- on line (that line)
I think it has something to do with the";
Any ideas?
The code is supposed to look like this (HTML):
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-thisismycode";
urchinTracker();
</script>
So my PHP looks like this:
echo "<script src=\"http://www.google-analytics.com/urchin.js\" type=\"text/javascript\">";
echo "</script>";
echo "<script type=\"text/javascript">";
echo "_uacct = \"UA-thisismycode";";
echo "urchinTracker();"
echo "</script>";
Which works, until it reaches this line:
echo "_uacct = \"UA-thisismycode";";
It gives this error when I load the page in a browser:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in ---------- on line (that line)
I think it has something to do with the";
Any ideas?