AdWords
1.8K members online now
1.8K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Conversion code not working in PHP

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have a form in an HTML page that sends the data to a PHP page that takes the information, puts it into a spreadsheet, then sends an email to alert someone that the form was fill out.
I have the code in the tag, below the

tags, but nothing is happening when i hit the page.
Creating a confirmation after the form is submitted HTML page is not an option.
Thanks in advance.
Kev

1 Expert replyverified_user

Conversion code not working in PHP

Top Contributor
# 2
Top Contributor

Hi Kev,

No content is returned by the PHP script? You want to register the conversion when the form is submitted? Are you using Tag Manager?

Pete

petebardo -- Deadhead doing AdWords

Conversion code not working in PHP

Top Contributor Alumni
# 3
Top Contributor Alumni

Hi Can you post page in question?

Regards, Nik
LinkedIn  |   @nikhilparachure | My Blog

Conversion code not working in PHP

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

I dont know.  All i know is that i was to copy and paste a chunk of code into the page.

I assumed that when the page was hit, the conversion code will fire.

 

Is this correct?

 

Conversion code not working in PHP

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

No, i cant.  

I can tell you that the <?php   ?>  tags are within the body tag and that the <script> </script><noscript></noscript> tags are below it, within the body tag.

Conversion code not working in PHP

Top Contributor
# 6
Top Contributor

Hi Kev,

Are you trying to register a conversion when the visitor hits the form page or after the form is submitted?

 

Pete

petebardo -- Deadhead doing AdWords

Conversion code not working in PHP

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Its because i was using AJAX to do a loadless call to the php page.

 

Too bad there isnt a function driven version of this.  On load is not ideal.

Conversion code not working in PHP

Top Contributor
# 8
Top Contributor

Hi MrKevMan,

The easiest way to record a conversion using AJAX is to return just the image portion of the conversion script. Do not include the <script> tags or anything in between. Do not return the <noscript> tags. Return only the img tag that is between the <noscript> tags. The data returned will record the conversion, and the AW cookie that is sent to google with the image request will properly attribute the conversion.

 

Best of Luck!

 

Pete

 

petebardo -- Deadhead doing AdWords