I get this error on submit:Parse error: syntax error, unexpected 'Any ideas?"> Google Conversion Tracking in OnSubmit doesn't work - Forums

Forums

Google Conversion Tracking in OnSubmit doesn't work

analographi 06 Mar, 2015
Answer
Hi

In the "Onsubmit" "custom code" I have the following code:

<?php
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1047843479;
var google_conversion_language = "de";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "2XniCKjFkVoQl6XT8wM";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/1047843479/?label=2XniCKjFkVoQl6XT8wM&guid=ON&script=0"/>
</div>
</noscript>
?>


I get this error on submit:
Parse error: syntax error, unexpected '<' in /home/subconsc/public_html/tentickle/administrator/components/com_chronoforms/form_actions/custom_code/custom_code.php(18) : eval()'d code on line 2


Any ideas?
analographi 06 Mar, 2015
I did check that before I started, and it doesn't help.
good job though, bot😉
Max_admin 06 Mar, 2015
1 Likes
Please remove the php tags:

<?php
and at the end:
?>

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
analographi 11 Mar, 2015
Thank you very much!
It's very appreciated!
ozi 12 Jun, 2015
My Google tracking code doesn't seem to work either. I've searched on this forum and followed the instructions. but it doesn't work. I've put a picture of the place where I've put the Google tracking code. Its in the 'Load JavaScript' section.

Anyone a idea how I can fix this?

Oz
GreyHead 12 Jun, 2015
Hi ozii,

Please use your browser web developer tools to check for javascript errors on the thank you page.

Bob
ozi 06 Jul, 2015
Hi,

Doesn't seem to work still. I'm not sure but can you put the google code in the 'Display message' block after the text section?
Maybe then it works? any idea?

Greetings from

Oz
GreyHead 07 Jul, 2015
Hi Ozi,

Did you check for JavaScript errors?

I think that the code will work in a Display Message action (provided that you have no PHP and use the plain text settings, not the Rich Text editor), or better a Custom Code action.

Bob
This topic is locked and no more replies can be posted.