Shopify——设置Google Ads增强型转化
增强型转换代码安装:
1、将以下代码黏贴在Shopify——设置——结账(checkout)——自定义脚本中(黑体处修 改为自己的转换 id 和转换 label,添加以下代码不需额外添加购买转换代码)
<!– Event snippet for purchase_conversion_cleverppc enhanced conversion –>
{% assign fa_send_to = ‘AW-xxxxxx/ixxxxxxx‘ %}
{% assign fa_include_tax_and_shipping = ‘no’ %}
{% 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 %}
<!– Event snippet for purchase_conversion_cleverppc enhanced conversion –>
2、Google ads 后台设置增强型转化,启用增强型转化,代码类型选择“全局网 站代码”,设置方式选择“输入 Javascript 或 CSS 选择器”,勾选打开电子邮件、 电话、姓名和地址,然后全部选择 Javascript,对应的填写内容如下:
电子邮件: enhanced_conversion_data.email
电话: enhanced_conversion_data.phone_number
名字: enhanced_conversion_data.first_name
姓氏: enhanced_conversion_data.last_name
街道地址: enhanced_conversion_data.home_address.street
城市: enhanced_conversion_data.home_address.city
州/省: enhanced_conversion_data.home_address.region
国家/地区: enhanced_conversion_data.home_address.country
邮编: enhanced_conversion_data.home_address.postal_code
3、检查测试
- a) 在测试前,请先确保你的 Tag Assistant已经点击”Enable”才开始测试
- b) 在完成下单并抵达感谢页面后(不能刷新该页面或重新游览该页面,只能再重新下单,再进入新的感谢页面),点击你的 Tag Assistant 查找成功触发的 GoogleAdsConversion Tracking,然后点击下方的”Request”
- c) 点击上方的”URLs”,再切换观看模式
- d) 往下滑并找到如截图 (screenshot3.png)的代码,如果有出现如截图中的格式代码,
即为成功
原创文章,作者:图帕先生,感谢支持原创,如若转载,请注明出处:https://www.yestupa.com/shopify-enhanced-conversion.html
评论列表(1条)
[…] Shopify 上的 Google & YouTube app提供给符合条件的 Shopify 商家,这是一个免费插件,允许 Shopify 商家将你的网店产品同步到 Google […]