Skip to main content
Contributor IV
February 21, 2024
Solved

Segmentation based on metadata

  • February 21, 2024
  • 18 replies
  • 473 views

Hi there

We want to help one of our clients be able to segment customers based off their booking period, rather than just their placed order date.

The company is renting items to private consumers, and we want to be able to send automated mails to the customers based on their pick-up and return dates - not just what date they placed the order.

However, currently this information is stored in the metadata, and therefore we can’t segment based on that data. Klaviyo Support says that we need to move the data “higher”, so we can see it in our property overview. However, they can’t be specific about WHERE we need to move the data, in order to be able to use it when segmenting it. 

Can anyone help exactly where in JSON this info needs to be present in order to qualify as “primary” data, so we can see it as a property just like we can with category, item name etc.

Any help would be much appreciated - thanks in advance!

Best regards
Mads

    This topic has been closed for replies.
    Best answer by KeviSunshine

    Hey Mads,

    Ah, I think I understand the issue now.

    You’re using a built-in WooCommerce <-> Klaviyo integration that (I’m assuming) automatically picks up the product’s metadata from the cart and supplies the “Metadata” field on the “Order” event. You cannot simply add metadata to the top-level event properties.

    I’ve never used this integration so I am at a loss now. However, I think I understand the problem and can format the question in a way that someone from the Klaviyo community might be able to better respond to…

    @carleygilmore – can you or someone on the Klaviyo team let us know if it’s possible to include woocommerce product metadata in the top-level fields of the “Placed Order” event? Does this data only go into the Metadata field?

    18 replies

    Contributor IV
    February 28, 2024

    Hi Kevin

    The last one I received from him was this.
    Not sure if this is what you mean by script - my apologies if not :-)

    add_filter('kl_added_to_cart','kl_modify_added_to_cart', 99, 4);

     

    function kl_modify_added_to_cart($added_to_cart, $added_product, $quantity, $wck_cart) {

      

       if( isset($_REQUEST['start_date_submit']) ){

          $start_date = $_REQUEST['start_date_submit'];

          $added_to_cart['booking_start_date'] = $start_date;

       }

       if( isset($_REQUEST['end_date_submit']) ){

          $end_date = $_REQUEST['end_date_submit'];

          $added_to_cart['booking_end_date'] = $end_date;

       }

      

       return $added_to_cart;

    }

    KeviSunshine
    Expert Problem Solver III
    Expert Problem Solver III
    February 28, 2024

    Hey Mads,

    Ah, I think I understand the issue now.

    You’re using a built-in WooCommerce <-> Klaviyo integration that (I’m assuming) automatically picks up the product’s metadata from the cart and supplies the “Metadata” field on the “Order” event. You cannot simply add metadata to the top-level event properties.

    I’ve never used this integration so I am at a loss now. However, I think I understand the problem and can format the question in a way that someone from the Klaviyo community might be able to better respond to…

    @carleygilmore – can you or someone on the Klaviyo team let us know if it’s possible to include woocommerce product metadata in the top-level fields of the “Placed Order” event? Does this data only go into the Metadata field?

    Contributor IV
    March 6, 2024

    Hi Kevin

    Did anyone from Klaviyo reach out to you yet?
    Really appreciate the help! :-)

    Best regards
    Mads

    KeviSunshine
    Expert Problem Solver III
    Expert Problem Solver III
    March 6, 2024

    Hey Mads, nothing yet, let’s try @’ing few more people…

     

    @David To – are you still around here? Any chance you could help Mads? It’s a bit of a thread, but essentially the question boils down to: is it possible to include woocommerce product metadata in the top-level fields of the “Placed Order” event? Or does this data only go into the Metadata field?

     

    Best,

    Kevin.

    Contributor IV
    March 13, 2024

    Hi Kevin

    Seems like it’s a bit difficult to receive support from Klaviyo, if you have a question that is deviating a bit from standard inquiries :(

    Thanks a lot for your help, I will see and try if I can get a hold of someone in support (again)

    Best regards
    Mads

    KeviSunshine
    Expert Problem Solver III
    Expert Problem Solver III
    March 19, 2024

    Yeah, sorry Mads. I hate to see a non-answer of mine have to be selected as the best answer.

    Did you try Klaviyo support? Creating a support ticket is really easy and they’re very helpful. I think you’ve certainly exhausted your other avenues, and I think you can frame your question to the support team in a way that they will be able to help.

    Contributor IV
    March 20, 2024

    I initially reached out to them, and they were actually the ones who referred me to Klaviyo Developer Group, because they said they couldn’t help with something of that nature.

    In a last desperate effort of help, are you able to provide me with an optimal framing of the question, that you believe would make support able to help?
    No strings attached if it doesn’t work out, you have done more than enough for me already :-)

    Best regards
    Mads

    KeviSunshine
    Expert Problem Solver III
    Expert Problem Solver III
    March 20, 2024

    Haha, no worries, I think this is the proper way to frame the question:

    Is it possible to include woocommerce product metadata in the top-level fields of the “Placed Order” event? Or does this data only go into the Metadata field?

    By default, the data goes into the “Metadata” field.

     

    Best of luck!