文章来源:香港龙8-long8 更新时间:2024-02-13 23:36
Google Ads增强型转化代码是应对GDPR等隐私政策更新的重要方式,可以在当前情况下,限度的跟踪到实际的广告效果,降低隐私政策更新带来的影响。本文将演示 Shopify网站设置Google Ads增强型转化代码的实操过程。
实操过程主要分为两个步骤:
1. Google Ads中增强型转化操作的设置
2. Shopify网站中添加增强型转化代码
以下为实操演示:
一、Google Ads账户中完成增强型转化设置
1. 创建Google Ads购买转化跟踪(如已创建可跳过)
参考文章:【shopify专栏】shopify怎么做转化跟踪
2. 打开Google Ads账户,点击“工具与设置” – “转化” –已创建的购买转化跟踪(转化来源是网站)
3. 点击“增强型转化”,在展开的对话框中,勾选“启用增强型转化”
勾选“全局网站代码或Google跟踪代码管理器”
点击“下一步”
输入网址,点击“检查网址”
选择“输入“JavaScript或CSS选择器”
分别勾选Email, Phone, First Name, Last Name, Street address, City, State, Country, Postal code, 并对应输入如下值后,点击保存
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
二、Shopify网站中添加增强型转化代码
1. 打开Shopify后台,点击Setting
2 点击Checkout
3 拉倒页面底部,找到Order status page - Additional scripts
复制以下代码模板到Additional scripts代码框中:
<!-- FEEDARMY START Global site tag (gtag.js) - Google Ads V1.7 -->
{% assign fa_send_to = 'AW-123456789/abcdefghijlklmnopq' %}
{% 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 == 'no' %}
{% assign fa_checkout_price = checkout.subtotal_price | divided_by: 100.0 %}
{%- else -%}
{% assign fa_checkout_price = checkout.total_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_code}}"
}
};
</script>
{% endif %}
<!-- FEEDARMY END Global site tag (gtag.js) - Google Ads V1.7 -->
4. 将框起来fa_send_to后面的部分替换为自己的转化代码。
自己的转化代码查找位置:
“工具与设置” – “转化” –已创建的购买转化跟踪(转化来源是网站) - 代码设置
找到事件代码段,复制“send_to”后的内容,替换增强转化代码中fa_send_to后的内容
最后点击保存,并跟进数据统计,通常系统需要3-7天来验证状态。