Mixpanel Community Icon

Extracting URL Path for Custom Event Property in Analytics

·
·

I want to parse url to create custom event property. I want to get path after domain before / or ?. For example, I want extract search from google.co.kr/search/blah

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    To parse a URL and extract specific parts in Mixpanel, you can use the parse_url() function. This function extracts the part of the URL that is specified, such as the domain or full domain. However, the parse_url() function as described in the Mixpanel documentation does not directly support extracting the path after the domain and before the / or ?.Here's how you can use the parse_url() function:LBKSparse_url(string property, “domain”) or parse_url(string property, “full_domain”) Example: parse_url(A,“domain”)LBKSIn your case, you might need to create a custom function or use additional string manipulation functions to extract the specific part of the URL you're interested in. Unfortunately, the provided knowledge sources do not provide a direct solution for your specific use case.

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ⤵️ Hint: Mention @kapa.ai in the thread for follow-ups.