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:
If you want to identify the user with their Shopify ID, always add
$user_id
as an event property (case sensitive)With each event that is sent, we automatically update below user properties so you don't need to send them
distinct_id
$device_id
$insert_id
$current_url
page_title
path_name
$browser
$device
$os
If you want to update the event source to indicate where events are coming from add
$source
(case sensitive). This will replace the default valueVendo - Shopify App