2.5.2, Google Analytics Advanced Applications - Data Import

Data import is to import external data to GA, and GA internal data integration, and operators can better measure the performance of your site conditions.

1. Why do you want to import

GA Although able to collect a lot of data lines, but there is some data that GA can not collect, and this part of the data is important for operations and decision-making, so it is necessary to import, such data include: offline data, third-party advertising platform advertising data, CRM data (customer relationshIP management, customer relationship management) and so on.

2. Principles of Data Import

The GA data is regarded as a table A, the imported data regarded as another table B, only the table to be associated two by a foreign key, i.e. tables A and B share a field, addition, Table B importing data fields are required fields, use the template used in the field of information built or custom dimensions to store imported.

3. The data import type

Data Import function, three types of data can be introduced, according to the three categories of logical data collection and processing to divide, such as the specific type listed in Table 2-19:

Table 2-19 imported data type

Limitations 4. Data Import

Data import function is a certain limit, here I mainly introduce several important limitations, there are other restrictions, but did not affect you, do not come in the following list:

  • Each media resources to build up to 50 Import Configuration
  • Every day, each property can import data 50 times
  • Upload files up to 1G
  • Involving ga: dat data, the daily limit 100M

5. Notes

  • In principle, quasi-import user personally identifiable information
  • If the imported field is empty, it is displayed in the report is not set

6. delete data

Click the corresponding need to upload a file "uploaded Management", and then check the files you want to delete, you can see the "Delete selected file" button, as shown in Figure 2-60:

 

Figure 2-60 delete data

 

 

Here are several methods of introducing, respectively, directly into, Google Sheet introduced, as well as introducing API

7. directly introduced

GA is directly introduced in the direct manipulation interface to import data, note that there are two points: First, the data must be stored in the imported csv file format, and second encoding format file must be utf-8, UTF is a simple -8 csv. Advertising here to import consumption data as an example, look at with the following specific settings and import process:

1、数据导入是媒体资源级别的,所以入口在媒体资源下面,在GA中选择“管理”→“数据导入”→“新建”,可以看到如图2-61所示的界面:

 

图2-61 导入数据

 

 

2、新建数据集

这里有很多种格式可以选择,不同格式表示导入数据的不同类型,如图2-62所示,GA已经内置了多种格式,详细的各个数据类型的解释看表2-19所列“导入数据的类型”,我们在这里选择“费用数据”:

 

图2-62数据集类型

 

 

3、自定义数据集命名后,选择对应导入进入的视图,如图2-63所示,导入的数据是视图级别的,需要选择导入到哪个视图去。

 

图2-63 选择数据视图

 

4、数据集架构, 这里的字段有三种类型:必须提供的字段,这里的是日期,媒介和来源,这个一般作为外键使用;然后是必须提供下列中至少一列,这个就是您需要的导入数据,这个位置是必选的,根据不同的数据集类型,GA会提供不同的字段给您选择;可以提供任意数量的以下列:这个是根据您自己需要可选,选择越多,导入的数据能匹配越细。

注意

需要注意的是导入行为那里有两个选项,一般默认选择汇总,不要选择覆盖,覆盖配置后是不可修改的,鉴于导入数量有限额,需谨慎使用。

配置完后保存,然后保存整个配置,如图2-64。

 

图2-64 数据集架构

 

 

5、然后就可以在数据导入的操作界面看到新增了一个导入配置,如图2-65所示,名称就是前面数据详细信息中的名称“导入消费数据”,类型是导入数据的类型,数据集ID整个是数据集ID,主要是用于使用API导入的时候需要使用的,“操作”下的“管理上传”就导入的入口了。

 

图2-65 管理上传界面

 

 

6、在GA中选择“管理”→“数据导入”→“管理上传”→“上传文件”→“选择文件”,如图2-66,选择预先准备的csv文件就可以导入

 

图2-66 选择文件

 

 

7、鉴于导入的时候需要utf-8的csv,所以我们通常采用的做法是直接下载GA提供的文件模板,然后复制相关数据进入,再上传,下载模板的位置是,单击数据上传中的需要获取模板的配置的名字,这里是“导入消费数据”,如图2-67所示:

 

图2-67 获取模板

 

 

然后可以看到如下界面,如图2-68所示,直接单击“获取架构”→“下载架构模板”就可以下载一个utf-8的csv模板

 

图2-68 下载模板

 

 

下载的模板如图2-69所示:

 

图2-69 模板结构

 

 

可以看到字段都是带有“ga:”,如果您是自己新建csv的形式,名字要按照上面的名字命名,对应字段的写法可以去官方文档找,建议采用下载模板的方法,不容易出错。

8、将需要导入的数据复制到模板后,按照步骤4的方法上传数据,如果成功会显示如图2-70所示:

 

图2-70 上传成功

 

这样就表示数据已经成功上传,官方说数据会24小时内出现,实际上,一般2小时左右就可以在GA看到相关的数据的。

如果报错的话,在“状态”会有相关提示的,根据相关提示去定位问题。

8.用Google Sheet导入数据

接下来介绍用Google Sheet知道导入数据的方法,这个要用到前面的数据集ID了,其实这个方法并没有比直接导入的方法方便,在这里作为一种拓展方法介绍给大家。

1、在这里我已经默认您知道导入数据的逻辑和已经新建了一个数据集(数据集就只指导入配置),在数据导入的控制面板可以看到数据集ID(这里用test2的数据集作为例子,如图2-71所示)

 

图2-71 导入数据管理界面

 

2、然后在Google Sheet里面新建一个表格,将要导入数据的字段如ga:userid,ga:dimension6输入,然后复制要导入的数据,如图2-72所示:

 

图2-72 要导入的数据

 

 

3、然后在Google Sheet中选择“工具”→“脚本编辑器”,将以下代码复制进入(完整代码访问获取),如图2-73:

 

图2-73 复制如代码

 

 

注意

要将红框标记的改为您自己的,最下面一个就是前面要用到的customDataSoureId就是数据集ID。

4、然后单击“资源”→“Google高级服务”,如图2-74所示,选择GA API开启,同时要确保Google API后台也做了权限的开放,如果您不确定,就进去单击开启吧。

 

图2-74 开启Gooogle API服务

 

 

5、然后单击运行了即可。

 

图2-75 运行成功

 

 

可以看到如图2-75的uploading OK就表示已经上传成功了

6、如果要做定时的话,可以单击触发器做些设置,如图2-76所示,就可以定时导入数据到GA

 

图2-76 定时运行

 

 

上图比较模糊,放大就是如图2-77所示:

 

图2-77 定时运行-放大

 

可以看到这个做法也只能是半自动的吧,如果您的服务器是在Google上面的,那就可以无缝运行了。

Guess you like

Origin www.cnblogs.com/ichdata/p/11711007.html