Google Analytics for one site with language specific domains - google-analytics

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

Related

Creating static paths with multiple constrained params

I'm now in the process of developing my small project and I'm not sure if it's even possible to do this the way I will describe below, so... I have dynamic routes like "/[community]/[townName]". How can I generate static paths where [townName] is constrained to [community]?
In other words - let's say we have townName "abc1". This town is in community "xyz1" so the page /xyz1/abc1 should be accessible and NOT throw 404. But there is also town with the same name "abc1" in "xyz2". So the path /xyz2/abc1/ should also be accesible.
However there is no town with same name in community xyz3 so I do not want to generate page for /xyz3/abc1/ - user should see 404 error.
Of course each town has it's unique ID in database and I could use it to generate pages, but I want my url to be SEO friendly.
All help and tips are appreciated. Thanks!
You should check getStaticPaths and dynamic routes from official Next.js website. It has more than one way to do what you want but there are additional customization options.

Track subdomains and query parameters within 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).

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.

How to OR solr term facets via the search URL in Drupal 7 site?

I have a Drupal 7 website that is running apachesolr search and is using faceting through the facetapi module.
When I use the facets to narrow my searches, everything works perfectly and I can see the filters being added to the search URL, so I can copy them as links (ready-made narrowed searches) elsewhere on the site.
Here is an example of how the apachesolr URL looks after I select several facets/filters:
search_url/search_keyword?f[0]=im_field_tag_term1%3A1&f[1]=im_field_tag_term2%3A100
Where the 'search_keyword' portion is the text I'm searching for and the '%3A' is just the url encoded ':' (colon).
Knowing this format, I can create any number of ready-made searches by creating the correct format for the URL. Perfect!
However, these filters are always ANDed, the same way they are when using the facet interface. Does anyone know if there is a syntax I can use, specifically in the search URL, to OR my filters/facets? Meaning, to make it such that the result is all entries that contains EITHER of the two filters?
Thanks in advance for any help or pointers in the right direction!
New edit:
I do know how to OR terms within the same vocabulary through the URL, I'm just wondering how to do it for terms in different vocabularies. ;-)
You can write a filter query that looks like:
fq=field1:value1 OR field2:value2
Alternatively you can use localparams to specify the query operator:
fq={!q.op=OR}field1:value1 field2:value2
As far as I know, there's not any easier way to do this. There is, in fact, an rather old bug asking for a way to OR the fq parameters...
I finally found a way to do this in Drupal
Enable the fq parameter setting.
Go to admin/config/search/apachesolr/[your_search_page]/core_search/edit or just navigate to the settings of the search page you're trying to modify
Check the 'Allow user input using the URL' setting
URL Syntax
Add the following at the end of the URL: ?fq=tid:(16 OR 38), where 16 and 38 are the term ids

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