将参数添加到Shopify购买活动

发布于 2025-02-09 18:47:32 字数 96 浏览 1 评论 0原文

为了更好地将购买活动与元帐户更好地匹配 - 并在其中改善广告交付 - 我需要添加电话号码,电子邮件,名字和姓氏,以便在Shopify中购买活动。

如何解决这个问题?

In order to better better match purchase events to Meta accounts - and therein improving ad delivery - I need to add Phone Number, email, first name and last name to purchase events in Shopify.

How would one go about this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉月流沐 2025-02-16 18:47:32

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

为此,您在设置下有一个部分 - >结帐 - > 该部分中的其他脚本

您可以使用液体变量。例如类似

 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 %}
    });

You need to add your script in the checkout (and thank you) page.

To do that you have a section under Settings -> Checkout -> Additional Scripts

In that part you can use the liquid variables. For example something like

 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 %}
    });

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文