goog_snippet_vars = function(){
var w = window;
w.google_conversion_id ="xxxxx";
w.google_conversion_label ="xxxxxx";
w.google_conversion_value ="xxxxxx";
},
goog_report_conversion = function(url) {
goog_snippet_vars();
window.google_conversion_format = '3';
window.google_is_call = true;
var opt = new Object();
opt.onload_callback = function() {
if (typeof(url) != 'undefined') {window.location = url;}
}
var conv_handler = window['google_trackConversion'];
if (typeof(conv_handler) == 'function') {conv_handler(opt);}
}
</script>
サーバーからstringbuilderを使用して、上記のコードをページ(onload)にダンプしています。そして私はstring.formatを使用して、サーバー側からWebページに表示されていない電話へのhtmlを生成しています。これをクリックすると、上記のスクリプトの関数の1つを呼び出す必要があります。そのために以下のコードを使用しました
string.Format("<a href=\"tel:{0}\" onclick=\"Javascript: goog_report_conversion(tel{0}); return false;\">{0}</a>", PhoneNumber));
htmlはテレ番号に適用されています。問題はクリックすることで、関数にヒットしていません。URLをhref値として新しいページに移動するだけです。
回避策があれば助けてください.....ありがとう...