向 Shopify 购买事件添加参数

问题描述 投票:0回答:1

为了更好地将购买事件与元帐户匹配 - 并从而改善广告投放 - 我需要在 Shopify 中添加电话号码、电子邮件、名字和姓氏以购买事件。

如何解决这个问题?

events shopify pixel
1个回答
0
投票

您需要在结帐(并感谢)页面中添加脚本。

为此,您可以在“设置”->“结帐”->“其他脚本”下有一个部分

在那部分您可以使用液体变量。例如类似

 window.dataLayer.push({
        ...
        page_type: "purchase",
        page_currency: "{{ shop.currency }}",
        {% if customer %}
        user_type: "member",
        user_id: "{{ customer.id | remove: "'" | remove: '"' }}",
        user_r: "{{ customer.last_order.created_at | date: "%B %d, %Y %I:%M%p" }}",
        user_f: "{{ customer.orders_count }}",
        user_m: "{{ customer.total_spent | times: 0.01 }}",
        user_eh: "{{ customer.email | sha1 }}"
        {% else %}
        user_type: "visitor"
        {% endif %}
    });

© www.soinside.com 2019 - 2024. All rights reserved.