精品国产三级a在线观看网站,亚洲综合色成在线观看,亚洲熟妇一区二区三区,,中文字幕成人精品久久不卡 ,永久免费av无码网站国产


注冊GTM:?https://tagmanager.google.com

粘貼GTM?code在shopify?theme.liquid?&?checkout

找到GTM追蹤代碼:

回到Shopify粘貼在theme?liquid和checkout頁面

Shopify——Theme——Actions下拉選擇Edit?Code

shopify——Setting——Checkout——Additional?scripts處填充


粘貼Shopify?dataLayer?(Checkout?-?Purchase)

目的:通過以下代碼可以讓GTM讀取和處理。該代碼塊包括以下變量:購買的產(chǎn)品、頁面類型、貨幣、運(yùn)輸價(jià)格、總價(jià)、稅價(jià)、支付類型和交易ID。我們能夠把所有這些數(shù)據(jù)傳遞給Google?Ads、Facebook?Pixel、Google?Analytics?4和其他你想分享的各方。

如下在checkout?GTMcode下面

******************************************Start*************************************

????<script>????

????window.dataLayer?=?window.dataLayer?||?[];????????????????????????????????????????????

????var?shipping_price?=?'{{shipping_price?|?money_without_currency?}}';

????shipping_price??=?shipping_price.replace(",",?".");

????var?total_price?=?'{{total_price?|?money_without_currency?}}';

????total_price??=?total_price.replace(",",?".");

????var?tax_price?=?'{{tax_price?|?money_without_currency?}}';

????tax_price??=?tax_price.replace(",",?".");

??????var?orderItemsName?=?[]????????????

??????var?orderItemsPrice?=?[]

??????var?orderItemsQuantity?=?[]

????var?orderItemsId?=?[]

??????var?totalQuantity?=?0;


??????{%?for?line_item?in?line_items?%}

??????????orderItemsName.push(?'{{?line_item.product.title?|?remove:?"'"?|?remove:?'"'}}')

??????????orderItemsPrice.push('{{?line_item.price?|?times:?0.01?}}');

??????????orderItemsQuantity.push('{{?line_item.quantity?}}');

??????????orderItemsId.push('{{?line_item.product_id?}}');

?????????totalQuantity?+=??{{?line_item.quantity?}};

??????{%?endfor?%}


??????{%?if?first_time_accessed?%}?

????window.dataLayer.push({

????'page_type':?'purchase',

????'event':?'analyzify_purchase',

????'currency':?"{{?shop.currency?}}",

????'totalValue':?total_price,

????'shipping':?shipping_price,

????'tax':?tax_price,

????'payment_type':?'{{order.transactions[0].gateway}}',

????'transaction_id':?"{{order.name}}",

??????'productName':?orderItemsName,

??????'productPrice':?orderItemsPrice,

??????'productQuantity':?orderItemsQuantity,

????'productId':?orderItemsId,

????});

????{%?endif?%}

?????</script>?

?*******************************************************END**********************************************

粘貼Shopify?Product?View?Data?Layer

點(diǎn)擊Theme,打開Snippets,然后添加File?name:?analyzify-product-datalayer

粘貼以下代碼然后保存

******************************************************START*********************************************

<script?type="text/javascript">

??window.dataLayer?=?window.dataLayer?||?[];


??window.appStart?=?function(){

????{%?assign?template_name?=?template.name?%}?


????window.productPageHandle?=?function(){

??????var?productName?=?"{{?product.title?|?remove:?"'"?|?remove:?'"'?}}";

??????var?productId?=?"{{?product.id?}}";

??????var?productPrice?=?"{{?product.price?|?money_without_currency?}}";

??????var?productBrand?=?"{{?product.vendor?|?remove:?"'"?|?remove:?'"'?}}";

??????var?productCollection?=?"{{?product.collections.first.title?|?remove:?"'"?|?remove:?'"'?}}"


??????window.dataLayer.push({

????????event:?'analyzify_productDetail',

????????productName:?productName,

????????productId:?productId,

????????productPrice:?productPrice,

????????productBrand:?productBrand,

????????productCategory:?productCollection,

??????});

????};


????{%?case?template_name?%}

????{%?when?'product'?%}

????????productPageHandle()

????{%?endcase?%}

??}


??appStart();

</script>

**********************************************************END*******************************************

然后復(fù)制這個(gè)代碼:?{%?render?'analyzify-product-datalayer.liquid'?%}

粘貼在theme?liquid的<head>中

將容器導(dǎo)入GTM

導(dǎo)入之后更新自己的GA4代碼進(jìn)入

完成后如下

這個(gè)可以用來當(dāng)conversions

最后驗(yàn)證代碼是否可行


鏈接成功后會(huì)跳轉(zhuǎn)你的網(wǎng)站,你網(wǎng)站頁面出現(xiàn)如下提示就是成功了

Tagassistant的頁面也會(huì)出現(xiàn)鏈接成功的提示如下


通過TAG?ASSISTANT檢查事件是否觸發(fā)成功

回到我們的GA頁面就可以看到更加詳細(xì)的產(chǎn)品信息顯示在報(bào)告里面

7.提交發(fā)布

回到GTM頁面,勾選導(dǎo)入的容器并點(diǎn)擊右上角的發(fā)布即可。

這周在深耕GA4和shopify的內(nèi)容,后面陸續(xù)更新相關(guān)資料~^

公眾號(hào)發(fā)送消息“GA4容器”即可領(lǐng)取相關(guān)資料!





點(diǎn)贊(1) 打賞

評論列表 共有 0 條評論

暫無評論

服務(wù)號(hào)

訂閱號(hào)

備注【拉群】

商務(wù)洽談

微信聯(lián)系站長

發(fā)表
評論
立即
投稿
返回
頂部