Magnetometer module directly into flight controller recognized by ardupilot?

Ok the best position for my gps may not be the best position for my magnetometer, kept having problems. Wonder if I buy those small LIS3MDL module, connect the I2C connection will it work with ardupilot?