Sometimes the most powerful features are the silent ones! Track by Name is a powerful silent feature. It allows you to track the following:
- Single Page Apps (SPAs); or
- those on-page content changes in single frames (dynamic content); or
- segment tracking; or
- A/B tests are served up from the same URL.
The default tracking method for a snapshot is to track using the URL. But in the situations named above, this method does not work well. Track by Name solves this problem.
Configure Track by Name on your Snapshots
When configuring your snapshot, you can go to more settings and change the tracking option to use Track by Name. This will provide you with the Track by Name code you will need to place on your source page. You would place this above the one-line Crazy Egg script you added.
< ! - Track a specific Crazy Egg snapshot by name - > <script type="text/javascript"> var CE_SNAPSHOT_NAME = "Variant A"; </script>
The Key to Track By Name - Troubleshooting
There are two reasons why Track by Name might not be working correctly. One reason, the name of your Snapshot does not equal the value of CE_SNAPSHOT_NAME. What you have between the quotes must be the same as the Snapshot name.
The second reason is that you haven't placed the code in the correct location. This is a common mistake when working with SPAs. Please email us if you have any trouble, and we will set up a call to take care of the issue.