Track subdomains and query parameters within Google Analytics - google-analytics

We have GA on a site that has hundreds of subdomains and each subdomain can have query parameters attached. I have a filter set up to show full domain and it's as follows...
Now, when I go to Behavior -> Site Content -> All Pages I see all the subdomain pages that were visted
john.male.personfinder.com
stacy.female.personfinder.com
mark.male.personfinder.com
sue.male.personfinder.com
What's not being "tracked" (probably the wrong term), is the query parameters that COULD follow the above urls.
john.male.personfinder.com
john.male.personfinder.com?state=ca
john.male.personfinder.com?state=ca&city=sf
Do I need to set up another filter to track these query parameters? Google Analytics is like a foreign language to me, so any walkthroughs and explanations would be GREATLY appreciated. Searching the web gave me mixed answers that didn't quiet match what I was looking for.
Thanks!

I think you will need to populate a custom dimension from your site, to get the parameter information.
Here's a snippet from my use of something similar:
$scoreid = $_GET["scoreid"];
...
<a name="metadata" id="metadata" data-scoreid="<?php echo $scoreid; ?>"></a>
I then use the data-scoreid DOM element to populate a custom GA dimension (in my case via a Google Tag Manager variable).

Related

WP Rest API: Can't seem to get embedded data from the post object

I am working with the WORDPRESS REST API and Wordpress version 4.8 for an internal network page at a local office. We have permalinks disabled (security reasons) and thus I am accessing the posts object like so:
https://url/blogs/usernamehere/?rest_route=/wp/v2/posts/12345
I am able to do a GET request and can get the posts data into my view template with no issues. However, I can't seem to figure out how to consume additional content in the post object . I have followed the documentation and tried to do:
https://url/blogs/usernamehere/?rest_route=/wp/v2/posts/12345?_embed=true
But, I get a STATUS 404 .
How would I correctly apply the embed function in the URL so I can get the additional data associated with the post?
Pass the _embed global parameter without a value, per the documentation.
you should do this:
https://url/blogs/usernamehere/?_embed=true&rest_route=/wp/v2/posts/12345
Basically you add _embed=true at before other parameters and after & add other parameters.

a Custom Filter for Domain and seperate Subfolder Match in Google Analytics

I have an unusual pattern that I need to create a filter for. I am trying to create a rolled up view for the following structure:
www.domain1.com/
and
www.domain2.com/shop/en-gb/domain2
I want to create the filter that would show all the traffic in domain1
and
also show the traffic in domain2 but only in the domain2 subfolder.
Both domains share the same UA- Tag
1. here is how I have tried to structure it:
a. Include filter for domain1.com and domain2.com
b. Exclude filter for domain2.com for traffic not in subfolder <-- This is where I can't seem to get it working.
Would appreciate anyones guidance as to what approach I should take.
Thanks
This might not be a beautiful solution...
Filter 1 - custom filter type "Search and Replace" with search string "domain2.com/shop/en-gb/domain2" and replace string "domain1.com"
Filter 2 - include only traffic to hostname that contain "domain1.com"
Make sure you arrange the filters in the correct order, since they are processed in order.
Remember that filters can't be applied to your historical data; they can only be applied to data going forward.

Combining similar URLs in Google Analytics (with a twist)

I have a lot of similar URLs that I would like to merge in Google Analytics. I've managed to merge a lot of them already. However I've now run into a bit of a problem.
I have URLs that look something like this;
article/4567/edit
article/87478548/edit
article/82984786/add
article/8374/add
How would I go about merging these URLs so that they display as;
article/edit
article/add
Any help is greatly appreciated.
EDIT: I also need to be able to have GA display every article in one line on the table called "article/" regardless of any ID that is after it. I don't want the table to look like:
article/12342 1,000 views
article/7465890 900 views
I need it to display as:
article/ 1,900 views
You can create an Advanced filter that combines the relevant parts for you:
The output would be /article/edit or /article/add, with everything and anything between those removed.
EDIT:
If you just want everything, regardless of /edit, /add, /12341/edit, /7305/add, /whatever/edit, to show up just as /article, then you can just change your filter like this:
Field A: Request URI = (/article)/.*
Output to: Request URI = $A1
This will convert the following examples:
/article/123/edit -> /article
/article/2345/add -> /article
/article/anything -> /article
From this Combining similar URLs in Google Analytics you can find out how to do it. You need to use a regex. Something like this should work (did not test it).
(article\/)[0-9]*\/(edit|add)

Google Analytics for one site with language specific domains

I have one site that serves EN and FR users. Each language has it's own domain, so englishcontent.com and frenchcontent.com. I'm setting up profiles, one for each. For the filters, would this be the correct setting
Type: Custom > Include
Field: Hostname
Pattern englishcontent.com
I would then have a profifile for French with the similar settings.
is this the best way to do this?
Yes, it should work, but keep in mind keep always a view without filter, in you case you need to have 4:
EnDomain View
FRDomain View
AllDomain View (No domain filter, but ip filter or any other needed)
Raw View (No Filter at all , this in case of something fails)
Take care of the variation of the domains and your filter. For example whats happens with the www variations or the subdomains.
Greetings
Example
PS: This structure is not the recomended one by Google, it suposes one account per brand, one property per domain and the desired views.
more information on:
https://analyticsacademy.withgoogle.com/course/1/unit/4/lesson/2

Unknown site using our analytics code

I did a review on our google analytics this morning and realised that we have a unknown site using our analytics code; this is because they copied our site design and even used our source code letter for letter.
Is there a way to filter out this site from our google analytics as there data is essentially scewing our data.
Cheers
You can filter out their data.
First, you can figure out what the domain is by adding the 'Hostname' secondary dimension in your content view. Once you have a handle on what hostnames its using (www.thief.com, thief.com, subdomain.thief.com, or whatever).
Create the filter (Instructions here: http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55494)
Set the filter to exclude traffic from the thief's hostname.
alt text http://files.droplr.com.s3.amazonaws.com/files/15648633/1x0Cbj.Screen%20shot%202010-08-13%20at%2011%3A43%3A42.png
(This thread has some details on how this implemented: http://groups.google.com/group/analytics-help-basics/browse_thread/thread/051be84cfb20338a?pli=1)
#yahelc , while your instructions are OK if you look at documentation, this filter often doesn't work.
I recommend to use
Custom Filter / Exclude filter / Filter field : Hostname , where can use a regexp pattern
To test your pattern, Go in Visitors / Network Properties / Hostname, and give it try in the filter box

Resources