アウトバウンドクリックトラッキングのための正しい汎用GAを実装しましたが、オフサイトをクリックしたときに発生する「スピードバンプ」ポップアップメッセージの1つも実装しましたリンク、以下のjavascriptを使用します。 (銀行クライアント - スピードバンプが必要)GoogleアナリティクスのアウトバウンドクリックとJavascript「スピードバンプ」を組み合わせる
これは、GAアウトバウンドクリックトラッキングを何らかの形で「破る」でしょうか? (人物クリックすると、モーダルボックスは、免責事項をポップアップ表示し、「続行」または「辞退」ボタンの選択見ている。)私がそこに持って
$(document).ready(function() {
$('.external').click(function() {
var link = $(this).attr('href');
$('<div>By accessing this link you will be leaving the site...</div>').dialog({
title: "Third-Party Site Disclaimer",
modal : true,
overlay: {
backgroundColor: '#fff',
opacity: 1
},
buttons: {
'Continue': function() {
$(this).dialog('close').remove();
window.open(link);
},
'Decline': function() {
$(this).dialog('close').remove();
return false;
}
}
});
return false;
});
});
Googleのアウトバウンドクリックトラッキングコード:
<script>
/**
* Function that tracks a click on an outbound link in Analytics.
* This function takes a valid URL string as an argument, and uses that URL string
* as the event label. Setting the transport method to 'beacon' lets the hit be sent
* using 'navigator.sendBeacon' in browser that support it.
*/
var trackOutboundLink = function(url) {
ga('send', 'event', 'outbound', 'click', url, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}
});
}
</script>
あなた自身でテストしましたか? –
アウトバウンドリンクトラッキングに使用した方法を教えてください。私の推測では、今は「去りたい」という意図だけを追跡しているということです...もっと明示的なユーザーアクションのために、このモーダルの「継続」と「拒否」機能の中にイベントを追加する必要があります。 – GreatBlakes
上記のアウトバウンドクリックコードを追加しました。ありがとうございました - これは私を超えています。 –