mixpanel / mixpanel-ruby

Other
172 stars 72 forks source link

Mixpanel with Turbo Rails #120

Open mpaluy opened 1 year ago

mpaluy commented 1 year ago

I'm getting the following error while trying to use the Turbo Rails link:

Mixpanel error: The Mixpanel library has already been downloaded at least once. Ensure that the Mixpanel code snippet only appears once on the page (and is not double-loaded by a tag manager) in order to avoid errors.

My layout code is:

<HTML>
<head>

<%= mixpanel_code %>

</head>
<body>
...
<%= link_to "Settings", my_settings_path %>
...

</body>
</HTML>

This issue doesn’t exist if Turbo Rails is disabled.

What’s correct way to use mixpanel with Turbo?

Thanks