Programmatically track subdomains in different view for google analytics - google-analytics

I've a site which allows users to register, creating a store front page like a shopping cart for them to customize. Each page is a subdomain of the main page, and is coded using one jsp.
Eg: User creates store front page named "abc", his store front page will be abc.mydomain.com
Is there a way to track these different subdomains individually separately using google analytics programmitically?
I've googled and currently did it by creating views and filters, but as i researched there are no way to create these views and filters programmitically, having to go to the google analytics page to create at there. I saw there is also a limit of views one can create thus am wondering if there are any other solution to this.
Thank You

You can use the Management API to create, update, and delete profiles, but as you've found out there is a limit of 50 profiles (views) per non-premium account. I would say to use advanced segments to segment out hostnames, but again there is also a limit of 100 advanced segments per view. One idea (and I haven't tested this) could be that when a user creates an account, they create a sub subdomain abc.foo.mydomain.com, and after there have been 100 sub subdomains created, switch the subdomain to bar.mydomain.com, etc. This way, you could get 5000 possible combinations. Again, you would want to test.
One other option, and this is similar to what Shopify does, is to have the user input their own GA account through the admin - but the downfall of this is that you (the site designer) wouldn't have visibility into that subdomains data.
Anyway, hope this helps.

Related

How do we run two A/B tests in Google optimize but only letting visitors enter one of the a/b tests?

For Example, We have two pages home page and contact page and both have their own variants in google optimize. So when visitor visit homepage and get the new variant from google optimize then it should not see a new variant of contact page when visitor redirects to contact page and vise Versa. Hope you get the point.
One approach is to track which variations users get into using cookies and target accordingly. So, let's say your user lands on the home page and is bucketed into the new variant. You use custom JS to drop a cookie along the lines of user_has_seen_new_variant=true, and in your second experiment you target based on whether or not people have that cookie.
Another approach would maybe be to combine your experiments into one, where you're targeting both pages. That way you would have control over what people are seeing on either page.

How do Google Analytics advanced segment filters work?

I'm trying to filter people who landed on a specific page and who were also new users (i.e., they landed on my site for the first time through this entry page).
That way I can track loyalty behavior of users who found my site via a specific landing page.
But I'm confused about the difference between using 'AND' in the same filter or creating a brand new filter in the GA's advanced filters.
I can't understand the difference between the two, but they do show slightly different data. Also, the loyalty is much better in the second version (with filters).
Which is the correct way to get the right data?
including and is a way to drill down into the exact thing you are looking for. It seems you were on the right track; I would put
Landing Page > Contains > URI
AND
User Type > Exactly Matches > New Visitor
If you use them together (I.E) URI of specific Landing page AND New Visitors, you will drill down to only new users who viewed your landing page.
If you create two separate Advanced segments, you will only get comparisons of new users who viewed your website to users who viewed your landing page.
What you could also do is create a new view(If you have Admin Access) and create a filter that only shows new visitors who came to your website via a specific landing page only.
I would say creating the filter in a new view is easier than the Advanced Segment.

Duplicate domain tracking on Google Analytics issue

We've accidentally placed the same Google Analytics tracking code on two different domains.
www.y.com
www.x.com
We've rectified the issue now but retrospectively, is there any way to filter that data going to the specific domain name www.x.com for example?
Note: this is not a duplicate of Google Analytics: Track two domains as one
You could add a filter to the view (profile) in question. That will remove the data that you don't want. Another option if you don't want to loose the data in the view would be to create a custom segment that you could use when ever you want to split the data out.
Update from Google+
You can search with regex
^/app/
in the small search bar (custom segment) in your page reports (e.g. Behavior -> Site Content -> All Pages), after which you can look at the aggregate metrics for all pages which start with /app/ (i.e. all the pages with different parameters).
If all the /app/.* have the same page title, you can look at the Behavior > Overview report, but choose Page Title as the dimension.

How to track one domain from two google analytics account?

We got one domain that has data for different client. What we wanna do is have a separate Google Analytics profile under one account to track traffic data for each of their pages.
In other word, in google analytics code can we have two Account id ? So both accounts can get see the tracking data for specific pages.
I think I have not made myself clear yet. let me try again..
There is one domain abc.com with several pages. For example abc.com/xvy belongs to userA and abc.com/kju belongs to userB. We have one google Analytics account that is tracking everything on abc.com. What I want to do is have another profile or new google analytics account to track all the data belongs to userA and userB separately. I do have an option to put different tracking code on pages that belongs to different users.
For example, pages belongs to userA can have diferent tracking from pages belong to userB.
But at the same time I want to track all the pages under one account as well...
Is there anyway I can achieve that ?
You should set up a separate profile for each area of the site you want tracked separately. Profiles all belong to the same account, so you will be able to see all of your data with a single sign-in.
Keep the same tracking code on all areas of the site, but just apply filters to the different profiles.
To follow your example, I would set up Profile A and Profile B. You could keep a Whole Site profile to collect all of the data, too, if that is useful to you. For Profile A, apply a Request URI filter for ^/xvy and for Profile B, apply a Request URI filter for ^/kju. I'm assuming here that the different areas of the site are defined by the first subdirectory, so you may have to adjust those filter suggestions if the structure of the site is different.

managing redirection with google analytics

I have a site that contains the file
redirect.php?id=123
It redirects folks to another site using an id it pulls from the database.
I'd like to track the page on Google Analytics, see where users are coming from, and what popular sites they're going to.. etc.
I currently set up the page so that it pulls (with PHP) the link from the database, and outputs the ga.js stuff and a javascript redirect.
The issue is that I'm getting the data on my analytics dashboard as if every id is a different page..
What is a better way to do this?
If you want to check for pages of the type redirect.php?id=x then the page Carlos links to is how you would do it.
You would want to exclude the id parameter from your search. Then Analytics would combine all the redirect.php?id=1 redirect.php?id=2 redirect.php?id=3 pages as just a single page named redirect.php
How do I exclude query parameters from my reports?

Resources