user3067592
user3067592

Reputation: 371

Issue with google conversion code

I have i minor issue with Google conversion code in my website, I insert the code in my thankyou.php page of my Woocommerce plugin as below:

/* <![CDATA[ */
var google_conversion_id = 546765765;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "whtaever";
var google_conversion_value = 0;
var google_remarketing_only = false;
/* ]]> */

But i got the error from Google that said "Minor issue" with code.

So i reviewed source of the page and found out that the "Greater than" converted to ">"

/* <![CDATA[ */
var google_conversion_id = 546765765;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "whtaever";
var google_conversion_value = 0;
var google_remarketing_only = false;
/* ]]&gt; */

Any idea?

Upvotes: 0

Views: 236

Answers (1)

user2679919
user2679919

Reputation:

Unfortunately there is still a problem with WordPress that has been documented for 6 years which replaces the end of the CDATA section "/* ]]> /" with "/ ]]> */". The quick fix for this is to comment out the offending code in /wp-includes/post-template.php.

function the_content($more_link_text = null, $stripteaser = false) {
      $content = get_the_content($more_link_text, $stripteaser);
      $content = apply_filters('the_content', $content);
/**   $content = str_replace(']]>', ']]&gt;', $content); */

Upvotes: 1

Related Questions