-1

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?

  • Search a blog or forum for a question like this. Reddit would be a great place to start, stackoverflow is for asking well thought out questions that one uses to become a better programmer and learn. Please post code or a concrete question to get valuable responses. – Beez Jun 23 '22 at 04:16

1 Answers1

0

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

Fabio Filippi
  • 1,732
  • 25
  • 40