Records an order in DCM Floodlight

@param {Object} cart - cart as `CartValue` object
@param {Number} orderId - the order id
@param {Object} wpcomJetpackCartInfo - info about WPCOM and Jetpack in the cart
@returns {void}
function recordOrderInFloodlight( cart, orderId, wpcomJetpackCartInfo ) {
	if ( ! isAdTrackingAllowed() || ! isFloodlightEnabled ) {
		return;
	}

	debug( 'recordOrderInFloodlight: record purchase' );

	debug( 'recordOrderInFloodlight:' );
	recordParamsInFloodlightGtag( {
		value: cart.total_cost,
		transaction_id: orderId,
		u1: cart.total_cost,
		u2: cart.products.map( product => product.product_name ).join( ', ' ),
		u3: cart.currency,
		send_to: 'DC-6355556/wpsal0/wpsale+transactions',
	} );

	// WPCom
	if ( wpcomJetpackCartInfo.containsWpcomProducts ) {
		debug( 'recordOrderInFloodlight: WPCom' );
		recordParamsInFloodlightGtag( {
			value: wpcomJetpackCartInfo.wpcomCost,
			transaction_id: orderId,
			u1: wpcomJetpackCartInfo.wpcomCost,
			u2: wpcomJetpackCartInfo.wpcomProducts.map( product => product.product_name ).join( ', ' ),
			u3: cart.currency,
			send_to: 'DC-6355556/wpsal0/purch0+transactions',
		} );
	}

	// Jetpack
	if ( wpcomJetpackCartInfo.containsJetpackProducts ) {
		debug( 'recordOrderInFloodlight: Jetpack' );
		recordParamsInFloodlightGtag( {
			value: wpcomJetpackCartInfo.jetpackCost,
			transaction_id: orderId,
			u1: wpcomJetpackCartInfo.jetpackCost,
			u2: wpcomJetpackCartInfo.jetpackProducts.map( product => product.product_name ).join( ', ' ),
			u3: cart.currency,
			send_to: 'DC-6355556/wpsal0/purch00+transactions',
		} );
	}
}