推自定義變量我使用GA代碼在我的網站像下面與谷歌標籤管理
<script type="text/javascript" language="javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxx-1']);
_gaq.push(['_setDomainName', '.myweb.co.uk']);
if (source != '') {
_gaq.push(function() {
extga._setCampValues(source, medium, name);
});
}
// Set the custom variable ranking
var url = String(document.referrer);
// confirm they came from G
if (url.indexOf("google.co") != -1 || url.indexOf("google.be") != -1 || url.indexOf("google.ie") != -1 || url.indexOf("google.fr") != -1) {
var urlVars = {};
var parts = url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {
urlVars[key] = value;
});
// Push to GA Custom Variables
_gaq.push(['_setCustomVar', '1', 'Keywords Rankings', urlVars["cd"], 1]);
}
//Track the record in GA
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
現在我想更換與谷歌代碼管理工具GA代碼。我的問題是,我們如何使用Google標記managera在Google Analytics上推送cstom變量,目前我正在使用_gaq.push方法爲廣告系列推送自定義數據。
問候, 哈比卜
感謝Blexy的幫助 –
您好我也使用_gaq.push(['_ trackPageview','/ activity-weekends/inquiry /']);將自定義目標推送到GA,我們如何在GTM中處理這個問題。謝謝 –