Article sections

    Step 1:

    Go to Online Store > Themes

    Step 2:

    Edit the code of your current theme

    Step 3:

    Go to Sections > header.liquid file

    Step 4:

    Add this section of code:

    {% if customer %}
    {% assign instructions = customer.metafields.rfm_reveal %}
    <script>
    window.rfm_score = ‘{{ instructions[‘rfm_score’] }}’;
    window.rfm_group_name = ‘{{ instructions[‘rfm_group_name’] }}’;
    window.rfm_group_id = ‘{{ instructions[‘rfm_group_id’] }}’;
    window.rfm = ‘{{ customer.metafields.rfm_reveal | json }}’; 
    </script>
    {% endif %}

    Step 5:

    Click Save

    Step 6:

    This code will return information such as:

    1. Rfm_customer_email
    2. Rfm_customer_first_name
    3. Rfm_customer_last_name
    4. Rfm_group_id
    5. Rfm_group_name
    6. Rfm_profit
    7. Rfm_revenue
    8. rfm_score

    Step 7:

    For more information on how meta fields are used, check out this article on Shopify: https://help.shopify.com/en/themes/liquid/objects/metafield