Last active
May 24, 2016 19:30
-
-
Save hijonathan/61fc42ff55c2d61f2754a5a1e8495e27 to your computer and use it in GitHub Desktop.
Using Appcues + Segment with anonymous visitors. This snippet can safely be added to your site via Google Tag Manager.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function() { | |
if (analytics != null && analytics.ready != null) { | |
analytics.ready(function() { | |
if (window.Appcues != null) { | |
if (analytics.user().id()) { | |
// Identify known user. | |
Appcues.identify(analytics.user().id(), analytics.user().traits()); | |
} else { | |
// Identify as an anonymous user. | |
Appcues.identify(analytics.user().anonymousId()) | |
} | |
} | |
}) | |
} | |
})() | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment