Created
December 10, 2018 01:02
-
-
Save tnorthcutt/930fca70f68949a5a54ee98ae0da04bd to your computer and use it in GitHub Desktop.
Limiting user tracking in a Laravel Spark app to real users signed into the app (not admins or admins impersonating a user)
This file contains 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> | |
<?php if (Auth::user() && Spark::developer(Auth::user()->email) || session('spark:impersonator')) { | |
?> Spark.state.devmode = true; <?php | |
} else { | |
?> Spark.state.devmode = false; <?php | |
} ?> | |
if (Spark.state.user && !Spark.state.devmode) { | |
// Intercom, FullStory, etc. tracking goes here | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment