Constant works fine unless you want to change the key before deploying to production. Here is how you can change default snippet in
\Views\Shared\\_Layout.cshtml to use the same instrumentation key as server monitoring using:
There are reasons not to use this by default. Performance is one of them. You may also want to separate end user behavior data from server-side telemetry. In any case keep in mind - by default there are two places where you need to change your instrumentation key when you deploying your application to production.