共计 2513 个字符,预计需要花费 7 分钟才能阅读完成。
1、首先在谷歌账户创建增强型购物事件
在谷歌账户打开转化列表
新建转化操作
选择网站
输入域名点扫描
选择手动添加转化操作
配置购物事件,最后选择完成
点击保存并继续
点击查看事件代码
复制事件代码里面send_to的值,点击完成
2、配置shopify
修改下面代码fa_send_to的值为刚刚复制的send_tod的值
fa_include_tax_and_shipping代表订单金额是否包括运费和税费,默认设置成yes(订单金额包括税费和运费),如果需要改成不包括运费税费的模式,需要将yes改为no
<!-- FEEDARMY START Global site tag (gtag.js) - Google Ads V1.5 -->
{% assign fa_send_to = 'AW-123456789/abcdefghijlklmnopq' %}
{% assign fa_include_tax_and_shipping = 'yes' %}
{% comment %}DO NOT EDIT BELOW{% endcomment %}
{% if fa_google_coding %}{% assign fa_google_coding = true %}{%- else -%}{% assign fa_google_coding = false %}{%- endif -%}
{% if fa_include_tax_and_shipping == 'yes' %}
{% assign fa_checkout_price = checkout.total_price | divided_by: 100.0 %}
{%- else -%}
{% assign fa_checkout_price = checkout.subtotal_price | divided_by: 100.0 %}
{%- endif -%}
{% assign fa_google_ids = fa_send_to | split: "/" %}
{% if fa_google_coding == false %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{fa_google_ids[0]}}"></script>
{%- endif -%}
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{fa_google_ids[0]}}', {'allow_enhanced_conversions':true});
</script>
{% if first_time_accessed %}
<script>
gtag('event', 'conversion', {
'send_to': '{{ fa_send_to }}',
'value': {{ fa_checkout_price }},
'currency': '{{ currency }}',
'transaction_id': '{{ order_number }}'
});
var enhanced_conversion_data = {
"email": "{{ customer.email }}",
"phone_number": "{{billing_address.phone}}",
"first_name": "{{ billing_address.first_name }}",
"last_name": "{{billing_address.last_name}}",
"home_address": {
"street": "{{billing_address.street}}",
"city":"{{billing_address.city}}",
"region": "{{billing_address.province}}",
"postal_code": "{{billing_address.zip}}",
"country": "{{billing_address.country}}"
}
};
</script>
{% endif %}
<!-- FEEDARMY END Global site tag (gtag.js) - Google Ads V1.5 -->
在shopify设置-结账-自定义代码的地方加入以上修改后的代码,点击保存
3、开启增强型转化
打开转化列表
点击刚刚添加的事件
点击增强型转化
选择启用增强型转化
点击下一步
点击检查网址
点击手动选择
选择全局代码,点击下一步
设置增强型转化发送的客户信息
各种数据设置代码参考下面数据
-
Email-电子邮件
-
enhanced_conversion_data.email
-
Phone-电话
-
enhanced_conversion_data.phone_number
-
First name-名字
-
enhanced_conversion_data.first_name
-
Last name-姓氏
-
enhanced_conversion_data.last_name
-
Street address-街道地址
-
enhanced_conversion_data.home_address.street
-
City-城市
-
enhanced_conversion_data.home_address.city
-
State-州
-
enhanced_conversion_data.home_address.region
-
Country-国家
-
enhanced_conversion_data.home_address.country
-
Postal code-邮编
-
enhanced_conversion_data.home_address.postal_code
最后点击保存