Skip to main content
Sending Custom Events
Updated over a week ago

You can use Shopify's Web Pixel API to send custom events to Mixpanel without having to Mixpanel code on the client side. Here's a sample code that you can add to your theme:
โ€‹

<script> 
Shopify.analytics.publish('replace_with_event_name', {
'replace_with_property_name': "xxx"
'$user_id': '6807172218927' // if exists it will identify user in Mixpanel. Only pass Shopify Customer ID
'$source': 'my_custom_source' // if exists it will replace default source Vendo - Shopify App
});
</script>

Some considerations:

  1. If you want to identify the user with their Shopify ID, always add $user_id as an event property (case sensitive)

  2. With each event that is sent, we automatically update below user properties so you don't need to send them

    1. distinct_id

    2. $device_id

    3. $insert_id

    4. $current_url

    5. page_title

    6. path_name

    7. $browser

    8. $device

    9. $os

  3. If you want to update the event source to indicate where events are coming from add $source (case sensitive). This will replace the default value Vendo - Shopify App

Did this answer your question?