You're adding network names to a traffic report. Each connection already has an IP address and perhaps an estimated location. An ASN lookup adds the network operator's name and another country field. Putting that second country into the visitor-location column would change what the report measures.
An autonomous system number, or ASN, identifies a network for routing purposes. The ASN API in API 2.0.0 looks up that number and returns asn, name, country, and country_name. Its country describes the network record. It doesn't describe every place that network operates, the location of a particular IP address, or where a person's device is standing.
If the report needs both kinds of country, give them different columns:
| Column | What it describes |
|---|---|
| Network country | The country recorded for the ASN |
| Estimated connection country | Location evidence associated with the IP address |
The values can differ without either column contradicting the other. Grouping by network country answers a question about the networks represented in the report. Grouping by estimated connection country answers a question about the connections' estimated locations. Neither grouping establishes a person's residence.
Keep the ASN beside the network name as well. A name is useful to read, while the number is the value to use when grouping the same network's rows. If network country is null, leave that column unknown. Borrowing the connection's country to complete it would make a location estimate look like a network-record fact.
The IP API is the relevant reference when the question starts with an IP address. Adding an ASN lookup should enrich the network context in that result, while keeping the connection-location evidence attached to its own fields.