简体   繁体   中英

How can I get merged data from website and mobile website for Google Analytics?

I have a website - and the website redirects the users automatically to its mobile site when the users access using mobile devices.

The problem is, Google Analytics treats those two pages as a separate page.

For exmaple,

http://story.pxd.co.kr/917 and http://story.pxd.co.kr/m/post/917

are same page but GA shows statistics as two different pages.

How can I merge the data from the two pages? (When I want to see mobile data only, GA already supports various ways for it)

Thank you in advance.

Jay

Untested as far as the regex goes and might need a little refinement, but the principle works like this:

Go to admin, views, filters. Create a new filter , custom, advanced.

In "Field A" select "Request Uri" from the dropdown.

In the text field at the right (extract) enter ". /m(. )" (without quotes). This extracts everything to the right of /m via and stores it (via the brackets) in variable (if it does not work at the first go you have to look up regexp with Google and refine). The values of that variable now should be in your example "/post/917", it is accessible later via the placeholder $A1 ("A" because it's from field A, "1" because it is the first value extracted. If you use more than one bracket you might also have $A2, $A3 etc).

Leave Field B empty.

In "Output To" select "Request Uri". Enter your hostname http://story.pxd.co.kr/ . Append the placeholder $A1 - this contains the page path without the "m".

All steps combined will change " http://story.pxd.co.kr/m/post/917 " to " http://story.pxd.co.kr/post/917 " and thus unify the urls so they will be displayed as the same page in the reports (you might want to include some custom dimension to discern if this was a mobile view or a desktop view, or you can use the "device category" as second dimension to see which was which).

Btw. data that has already been recorded will not be changed, filters do not work on historical data. And be sure to keep a view without filters (filters are destructive and if you make a mistake you won't be able to recover the data).

在此处输入图片说明

Thank you Eike, With your hint, I found better way. I used 'Advanced Filter' with 'Search and Replace' So let the GA search /m/post/ and replace with / Thank you!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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