Created
March 13, 2017 01:49
-
-
Save jonatassalgado/d741cd760e0cdd64c49ad1253acba216 to your computer and use it in GitHub Desktop.
Segment first time user access website
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
| var firstTime = analytics.user().traits().firstTime == undefined ? "TRUE" : "FALSE"; | |
| if (firstTime == "TRUE") { | |
| console.log('Sua primeira vez aqui!'); | |
| analytics.identify({firstTime: "TRUE"}) | |
| analytics.track('Landing Page', {firstTime: "TRUE"}); | |
| } else { | |
| console.log('Voce ja visitou o site!'); | |
| analytics.identify({firstTime: "FALSE"}) | |
| analytics.track('Landing Page', {firstTime: "FALSE"}); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment