Although the data that Google Analytics usually obtains comes from the tracking code, it is possible to add data from other sources. In this way, we can get a contextual view of them in the analyses that are made.

There are two ways to add data to Analytics from other sources without using tracking code:
- Linking accounts.
- Importing data.
The control of both methods is done from the Google Analytics settings.
In this way, both the data you import and the data provided by the GA tracking code are processed together, adding new insights to your analyses.
Account Link

Mediante el enlace de cuentas podremos agregar datos de varios productos de Google, como Google Adwords, Google Adsense y Google Search Console (AKA Google Webmasters Tools). Mediante este enlace de cuentas, los diferentes productos enviarán sus datos a Analytics para que este los integre como datos propios. Así, por ejemplo, si enlazamos Google Adwords, será posible ver datos de clics, impresiones y costes de Adworks en Analytics. o si enlazamos Search Console, se podrá tener una visión más precisa sobre los términos de búsqueda han utilizado en Google los usuarios para llegar a nuestra Web (reduciendo el famoso not set que aparece cuando se filtra un informes por términos de búsqueda). También podemos enlazar con otros productos como Ad Exchange, servicios de DoubleClick, Google Play o con notificaciones desde redes de publicidad de terceros.
Data import

The other method of adding data to Analytics is by importing data, for example data from advertising campaigns, or product data, or any other type of data. In order to import, there must be a data field that acts as a common key between the external source from which we get the data and Analytics, to allow us to connect both datasets.
Two methods are available for this:
- Crear una Definición Personalizada (lo que antes se llamaba Dimensión personalizada o Dimension Widening).
- Mediante la importación de datos de datos de costes.
Custom dimensions
Con la creación de Definiciones Personalizadas es posible importar cualquier dato a GA. Imaginemos que tenemos un sitio Web en el que escriben varios autores y queremos saber quienes tienen el contenido más popular, en ese caso deberíamos crear una Definición Personalizada con el nombre autor de tipo hit que te permitirá tener un nuevo informe en el que se recojan las páginas visitadas agrupadas por autor en el que el campo clave sea la URL del artículo.

The data can be uploaded through a csv file or through the Google Analytics API, in this case it can be sent as a hit, modifying the Google Analytics tracking code and adding the index that Analytics has assigned to that dimension.
ga('send', 'pageview', {
'dimension5': '<?=$author?
});
Importing Cost Data
El otro método para agregar datos a Analytics es la importación de datos de costes, que se usa principalmente para añadir aquellos datos que supongan una evaluación monetaria, por ejemplo, el tener la información de una campaña cpc generada en Bing. De esta forma, podremos saber el retorno de la inversión en estas campañas.

To be able to perform this import, we will have to create a file that includes the source and medium of the campaign, data that will be the key with which we can link the campaign data with those we already have in Analytics. To do this, the following steps must be followed:
- Implementar las url de la campaña personalizada.
- Crear un conjunto o estructura de datos.
- Generar los datos de subida como un archivo CSV.
- Subir los datos de clics y de costes desde el archivo csv creado.
In short, we can incorporate external data to our Analytics property, either from Google products from the integration or from the import, either automatically or by uploading csv files. Both methods will allow us to have a better context of the data we analyze and will allow us to measure more effectively the performance of our website or application.
I invite you to leave your impressions and/or doubts in the contact form and to suggest new topics that you would like me to cover in these tutorials. I will be happy to answer you by email and write in this blog.