简体   繁体   English

Google Analytic搜索并根据列表进行替换

[英]Google Analytic Search and replace according to list

Scenario: 场景:

In Google Analytic, I notice that it is possible to replace certain URI parameter to words that you want by using search and replace filter like the following example below. 在Google Analytic中,我注意到可以使用搜索和替换过滤器将某些URI参数替换为所需的单词,如下面的示例所示。

eg www.example.com/abc/product_id=3 -----> www.example.com/abc/product_name=shampoo 例如www.example.com/abc/product_id=3 -----> www.example.com/abc/product_name=洗发水

Problems: 问题:

Currently I've got a list of over 1000 products in my hand, instead of creating 1000 search and replace filter, what would be the most efficient and maintainable way to go solve the problem? 目前,我手里有超过1000种产品的列表,而不是创建1000个搜索和替换过滤器,什么是解决问题的最有效和可维护的方法?

I've done some digging and notice that custom dimension could be the solution, however it would require me to modify the the JS code on the FTP sever which I dont have permission on. 我做了一些挖掘,发现自定义维度可能是解决方案,但是这将需要我修改我没有权限的FTP服务器上的JS代码。 What other solutions do I have? 我还有什么其他解决方案?

If it is not possible to show it here would there be any kind of tutorial that I could follow through? 如果无法在此处显示它,那么我可以进行任何形式的教程吗?

Really appreciate for the help, Many Thanks 非常感谢您的帮助,非常感谢

This is not a complete answer, but it's certainly more than a comment. 这不是一个完整的答案,但肯定不仅仅是评论。

Besides the tedium of writing this out by hand, I can think of two options available to you. 除了繁琐的手工编写之外,我还可以想到两个可用的选项。

Firstly, you could use the Google Analytics Management API ( https://developers.google.com/analytics/devguides/config/mgmt/v3/ ). 首先,您可以使用Google Analytics(分析)管理API( https://developers.google.com/analytics/devguides/config/mgmt/v3/ )。 By constructing a set of commands, you could quickly iterate through your list and create the required 1,000 search and replace filters. 通过构造一组命令,您可以快速遍历列表并创建所需的1,000个搜索和替换过滤器。

Secondly, if you were to use Google Tag Manager you would be able to create a Custom JavaScript Variable that takes the page path and compares it to your list. 其次,如果您要使用Google跟踪代码管理器,则可以创建一个自定义JavaScript变量,该变量采用页面路径并将其与列表进行比较。 This variable could then replace the Page field before the hit data is sent to Google Analytics. 然后,此变量可以在将匹配数据发送到Google Analytics(分析)之前替换Page字段。 This may sound more complicated, but it would allow you to pull your solution out of Google Analytics and into the flexible world of JavaScript. 这听起来可能更复杂,但是它可以让您将解决方案从Google Analytics(分析)中提取出来,并进入灵活的JavaScript世界。

Note that if you rewrite the product_id to a product_name once, you will have to maintain that cross reference every day and keep it in sync with what appears on the website -- make sure you have an automated solution or it will quickly get out-of-sync and be more of a mess than before. 请注意,如果您一次将product_id重写为product_name,则必须每天维护该交叉引用,并使它与网站上显示的内容保持同步-确保您拥有一个自动化的解决方案,否则它会很快消失。 -sync,并且比以前更加混乱。

An alternative is to do the search-and-replace on the reporting side. 另一种方法是在报告方进行搜索和替换。 I know Analytics Edge or Analytics Canvas products could easily do this, or you could just download into Excel or Google Sheets and do a series of lookup formulae. 我知道Analytics Edge或Analytics Canvas产品可以轻松做到这一点,或者您可以下载到Excel或Google表格中并执行一系列查找公式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM