Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<script>/* Chameleon - better user onboarding */!function(t,n,o){var a="chmln",c="setup identify alias track set show on off custom help _data".split(" ");n[a]||(n[a]={}),n[a].accountToken=o,n[a].location=n.location.href.toString();for(var e=0;e<c.length;e++)!function(){var t=n[a][c[e]+"_a"]=[];n[a][c[e]]=function(){t.push(arguments)}}();var s=t.createElement("script");s.src="https://fast.trychameleon.com/messo/"+o+"/messo.min.js",s.async=!0,t.head.appendChild(s)}(document,window,"SAtlPjYMWGA1jiV7AYF1D38gSa7SE9xEoRdJwPkr58eIyh-1C3H6Z-ztbpXMzr0tGiPmve");
chmln.identify({uid: user.id /* A stable, unique identifier */, email: user.email, created: user.created_at /* Timestamp when the user was added to your system */})
</script>
proposed:
{% if current_membership != None %}
!function(t,n,o){var a="chmln",c="setup identify alias track set show on off custom help _data".split(" ");n[a]||(n[a]={}),n[a].accountToken=o,n[a].location=n.location.href.toString();for(var e=0;e<c.length;e++)!function(){var t=n[a][c[e]+"_a"]=[];n[a][c[e]]=function(){t.push(arguments)}}();var s=t.createElement("script");s.src="https://fast.trychameleon.com/messo/"+o+"/messo.min.js",s.async=!0,t.head.appendChild(s)}(document,window,"SAtlPjYMWGA1jiV7AYF1D38gSa7SE9xEoRdJwPkr58eIyh-1C3H6Z-ztbpXMzr0tGiPmve");
chmln.identify({
id: '{{ current_membership.id }}',
email: '{{ current_membership.user.email }}',
created: '{{ current_membership.user.date_joined }}'
});
</script>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.