private BrowserMonitoringConfigurationData GetBrowserConfigurationData(IInternalTransaction transaction, TransactionMetricName transactionMetricName, string licenseKey)
        {
            var configuration = _configurationService.Configuration;

            var beacon = configuration.BrowserMonitoringBeaconAddress;

            if (beacon == null)
            {
                throw new NullReferenceException(nameof(beacon));
            }

            var errorBeacon = configuration.BrowserMonitoringErrorBeaconAddress;

            if (errorBeacon == null)
            {
                throw new NullReferenceException(nameof(errorBeacon));
            }

            var browserMonitoringKey = configuration.BrowserMonitoringKey;

            if (browserMonitoringKey == null)
            {
                throw new NullReferenceException(nameof(browserMonitoringKey));
            }

            var applicationId = configuration.BrowserMonitoringApplicationId;

            if (applicationId == null)
            {
                throw new NullReferenceException(nameof(applicationId));
            }

            var jsAgentPayloadFile = configuration.BrowserMonitoringJavaScriptAgentFile;

            if (jsAgentPayloadFile == null)
            {
                throw new NullReferenceException(nameof(jsAgentPayloadFile));
            }

            var obfuscatedTransactionName = Strings.ObfuscateStringWithKey(transactionMetricName.PrefixedName, licenseKey);
            var queueTime       = transaction.TransactionMetadata.QueueTime ?? _zeroTimespan;
            var applicationTime = transaction.GetDurationUntilNow();

            var attributes = new AttributeValueCollection(AttributeDestinations.JavaScriptAgent);

            _transactionAttributeMaker.SetUserAndAgentAttributes(attributes, transaction.TransactionMetadata);

            // for now, treat tripId as an agent attribute when passing to browser.  Eventually this will be an intrinsic but need changes to browser code first.
            // if CrossApplicationReferrerTripId is null then this transaction started the first external request, so use its guid
            _attribDefSvc.AttributeDefs.BrowserTripId.TrySetValue(attributes, transaction.TransactionMetadata.CrossApplicationReferrerTripId ?? transaction.Guid);

            //This will resolve any Lazy values and remove null values from the collection.
            //Browser monitoring should not render JSON for attributes if there are none
            attributes.MakeImmutable();

            var obfuscatedFormattedAttributes = GetObfuscatedFormattedAttributes(attributes, licenseKey);
            var sslForHttp = configuration.BrowserMonitoringUseSsl;

            return(new BrowserMonitoringConfigurationData(licenseKey, beacon, errorBeacon, browserMonitoringKey, applicationId, obfuscatedTransactionName, queueTime, applicationTime, jsAgentPayloadFile, obfuscatedFormattedAttributes, sslForHttp));
        }