AdWords
1.7K members online now
1.7K 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

Showing Error in Conversion Code

Explorer ✭ ✭ ☆
# 1
Explorer ✭ ✭ ☆

Hi Guyz,

 

  In one of my hotel industry campaign, I am using conversion tracking to track value of conversion. But the code is not working for me, Tag assistant shows Error Dynamic conversion value in wrong format and No HTTP response detected. Below is the code, please tell what type of changes are required in code for tracking conversion value.

 

<!-- Google Code for Lead Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = xxxxxxxxx;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "5xlcQ86CoywM";

if (<%= totalValue %>) {
		var google_conversion_value = <%= totalValue %>;
	}
var google_conversion_currency = <%= currency %>;

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/xxxxxxxxx/?value=<%=totalValue %>&conversion_currency=<%=...&amp;label=5xlcQ86CoywM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

2 Expert replyverified_user

Re: Showing Error in Conversion Code

Top Contributor
# 2
Top Contributor

Hi Puneet,

 

Did you check this troubleshooting help center reference of Tag Assistant to see what element you might be missing in your script and probably that is triggering this error:

 

https://support.google.com/tagassistant/answer/2947038?hl=en

 

Pankaj

Re: Showing Error in Conversion Code

Explorer ✭ ✭ ☆
# 3
Explorer ✭ ✭ ☆
Hi Pankaj,
According to this a numeric value should come at var google_conversion_value. But in the code it is returning a function to calculate conversion value. Not getting why the conversion value is not getting calculated here.

Regards
Puneet

Re: Showing Error in Conversion Code

Top Contributor
# 4
Top Contributor
Hi Puneet,

Looks like .asp or .aspx. You say you're calling a function to calculate conversion value, but you have a variable in the script. I have a couple suggestions.

First, be sure 'totalValue' is the correct variable name, including case of that name. If you are really intending to call a function, make it totalValue() to call that function.

Second, where ever you have <%= totalValue %> in your script, surround it with quotes, single or double, it doesn't matter. ('<%= totalValue %>') This will prevent your script from throwing an error if the value returned is an empty string.

Third, put through a test conversion then inspect the source of your thank you page to make sure the totalValue is being replace by the actual value of your conversion. Usually, the conversion code will always be on your thank you page, no matter the source of the conversion. If this is your case, just make a test purchase and inspect the source to see that the actual value of your conversion has been substituted for the totalValue.

If you are going directly to the page and the code appears as it does above, the Tag Manage will always report an error, even if the values are properly replaced after and actual sale.

Best of Luck!

Pete
petebardo -- Deadhead doing AdWords

Re: Showing Error in Conversion Code

Explorer ✭ ✭ ☆
# 5
Explorer ✭ ✭ ☆
Hi Petebardo,

I didn't tried inspecting conversion code by just going directly to the page. I made all the required steps in making a conversion and then checked the code on Thankyou page.
Actually the developer has pasted the code on thankyou page as it was given by me. I think there is some editing required from developer's end too to make it functional for booking amount value.

Thanks
Puneet

Re: Showing Error in Conversion Code

Top Contributor
# 6
Top Contributor
Hi Puneet,

I think you're on the right track. What you put in the "totalValue" part of this script must point to the correct variable or function to return the value of the sale. That all depends on your shopping cart software.

Are you seeing nothing for the value, or do you see the original <%= totalValue %>? If you see nothing, the syntax is correct but the variable name is wrong. If you see the original, the <%= .. %> is wrong for your server-side scripting language. This syntax is generally for Windows web severs, usually asp or aspx pages.

Best of Luck!

Pete
petebardo -- Deadhead doing AdWords