Compare 2 custom dimensions using filters - google-analytics

On first sight it seems impossible to compare one custom dimension to another using filters.
Case:
I've got 2 custom dimensions, I want a report where I can see how many of my visitors have CD1 = CD2, generic that is , so no specific cases.
In other words : show me every record where CD1 is exactly the same as CD2.
Is this possible?

In my answer, I am making the assumption that CD1 and CD2 are session scoped custom dimensions. These really aren't perfect answers to your question, but no other natural way springs to mind. To find how many sessions match this criteria, you could:
1 - Use BigQuery
Not available for free users, but with premium access, you could run simple SQL to list all users WHERE CD1 = CD2
2 - Custom Report Then Filter
Using a custom report feature, you would enter both CD1 and CD2 as dimensions, and select sessions as the metric. This would give you a report that may look like:
CD1 CD2 Users
--- --- -----
A A 100
A B 200
B A 100
B B 200
From that, you can see that CD1=CD2 for 300 users.

Related

How to grab items with specific value in DynamoDB?

I'm setting up a table of people in DynamoDB, and I'd like to tag those people.
For demonstrations purposes lets say those tags are just strings... "tall", "short", "likes baseball" and so on...
How can I set up the data so I can quickly query all the people with a specific tag, like all the "tall" people?
Can I avoid scanning the table? Can I avoid creating multiple tables? Is this actually a much better use case for relational data structures? What if I come up with new tags on the fly? Relational doesn't work in that case.
Update:
People Tags Mappings
====== ==== ========
John firefighter John > firefighter
Sally young John > young
Joe owner Sally > owner
Anne staff Anne > owner
Chris zebra-lover Chris > zebra-lover
Ben 42 Ben > zebra-lover
In general to avoid scanning when you want to query an attribute which is not the primary key, you can use global secondary keys. For your case that probably doesn't work well, as you might want to be able to tag people with multiple tags at once.
Therefore I'd instead go for a separate table which just contains mappings of tags to people. In that table one item should be the mapping of one tag to one person. If a person has multiple tags, just add multiple items in there.
That way you'd query the tag-table for a given tag to get the primary key of all the people you're searching and would do another query against the people-table afterwards to get their details.
That works for new tags as well, as they'd mean just additional items in the tag-table.

Google analytics syntax event label and or results don't match

I am new to querying GA with event label filters and am trying to work out my mistake with the following syntax. I have 3 different event label filters on 3 separate reports which are identical, except for the variation in this query:
Report filter 1: ga:eventLabel==Login - Create Account Step 2
Report filter 2: ga:eventLabel==Login - Create Account Step 2;ga:eventLabel!=Where to Buy Step 2 Submit Query
Report filter 3: ga:eventLabel==Login - Create Account Step 2;ga:eventLabel==Where to Buy Step 2 Submit Query
Now, I would expect that the count of sessions and users I get from report filter #1 would equal the sum of results from report filters #2 and #3. But actually, report filter #2: ga:eventLabel==Login - Create Account Step 2;ga:eventLabel!=Where to Buy Step 2 Submit Query returns counts of users and sessions orders of magnitude larger than the other 2 queries. (like 70K vs 120ish). Feels like there's a classic beginner conceptual error I'm making here, but I'm not sure how to google the the right question. Any ideas what I'm doing wrong?
Thanks for any help.
What you are trying to query with session/user metrics won't really work the reason being is that events are hits and so filtering that way filters on the hits. The way to get around that is to create segments of users that have triggered the events that you are interested in.
Now if you were to report on events/unique events using those filters based on the logic there I would expect #1 and #2 to return the same results and #3 to contain no values.

ga:visits showing zero when ga:pageviews, ga:visitors show values?

I have a top profileid and a filtered profileid.
the filtered profileid uses a path starting with /xxx/yyy/
now in site I have 2 view pages -
1) top profile + my filter of /xxx/yyy/
2) sub profile
both pages show the same number and values for pages
but when I do a view of "ga:pageviews, ga:visitors, ga:visits"
I get different values only for visits (sometimes 0 on #1)
examples of output
1)
70 5 1
40 8 0 <--how can I get a zero?
2)
70 5 6
40 8 8
so hitting the top profile and adding my filter to the call gives me invalid visits.
using the same code for profile #2 I get correct numbers.
looking inside google admin, profile 2 only has the 1 filter and it matches the same as what I am doing in code. also the pages match up so this does not make sense to me.
how is it possible to get numbers but have no visits?
is there a way to get an individual listing of the data that it is using to output to my filtered request?
http://www.analyticsedge.com/2014/09/misunderstood-metrics-sessions-pages/
I think I figured this out. doing the filter inside google as a separate profile will retag the first page to a session count, whereas if I query the top profile and filter on my end I will get very low session starts because most people hit the home page or login page which counts as their session start.
it seems I cannot use the metric sessions or visits along with my filtering to a sub section.

Allow users to create new categories and fields on ASP.NET website

We have a db driven asp.net /sql server website and would like to investigate how we can allow users to create a new database category and fields - is this crazy?. Is there any examples of such organic websites out there - the fact that I havent seen any maybe suggest i am?
Interested in the best approach which would allow some level of control by Admin.
I've implemented things along these lines with a dictionary table, rather than a more traditional table.
The dictionary table might look something like this:
create table tblDictionary
(id uniqueidentifier, --Surrogate Key (PK)
itemid uniqueidentifier, --Think PK in a traditional database
colmn uniqueidentifier, --Think "column name" in a traditional database
value nvarchar, --Can hold either string or number
sortby integer) --Sorting columns may or may not be needed.
So, then, what would have been one row in a traditional table would become multiple rows:
Traditional Way (of course I'm not making up GUIDs):
ID Type Make Model Year Color
1 Car Ford Festiva 2010 Lime
...would become multiple rows in the dictionary:
ID ITEMID COLUMN VALUE
0 1 Type Car
1 1 CarMake Ford
2 1 CarModel Festiva
3 1 CarYear 2010
4 1 CarColor Lime
Your GUI can search for all records where itemid=1 and get all of the columns it needs.
Or it can search for all records where itemid in (select itemid from tblDictionary where column='Type' and value='Car' to get all columns for all cars.
In theory, you can put the user-defined types into the same table (Type='Type') as well as the user-defined columns that that Type has (Type='Column', Column='ColumnName'). This is where the sortby column comes into it - to help build the the GUI in the correct order, if you don't want to rely on something else.
A number of times, though, I have felt that storing the user-defined dictionary elements in the dictionary was a bit too much drinking-the-kool-aid. Those can be separate tables because you already know what structure they need at design time. :)
This method will never have the speed or quality of reporting that a traditional table would have. Those generally require the developer to have pre-knowledge of the structures. But if the requirement is flexibility, this can do the job.
Often enough, what starts out as a user-defined area of my sites has had a later project to normalize the data for reporting, etc. But this allows users to get started in a limited way and work out their requirements before engaging the developers.
After all that, I just want to mention a few more options which may or may not work for you:
If you have SharePoint, users already have the ability to create
their own lists in this way.
Excel documents in a shared folder that are saved in such a way
to allow multiple simultaneous edits would also serve the purpose.
Excel documents, stored on the webserver and accessed via ODBC
would also serve as single-table databases like this.

Drupal: Views Grouping Issue

With CCK, I've added a field to the basic "Page" node type called "Resource Type". There are four possible resource types to choose from, in a dropdown, "Training, News, Research, Tools".
I've created a view that should group the nodes by their resource type. I've created 8 nodes, 6 of which are of type "Training", 1 is of type "Tools" and 1 is of type "News". Drupal is outputting the following:
Training
- Training Node 1
- News Node 1
- Tools Node 1
- Training Node 2
- Training Node 3
Tools
- Training Node 4
News
- Training Node 5
Research
- Training Node 6
When I tested with only 1 node per resource type, it displays as expected:
Training
- Training Node 1
Tools
- Tools Node 1
News
- News Node 1
I saw the other posting where the Devel module can screw up the output, but I'm seeing the above while the user is logged out (and therefore Devel is disabled for anonymous users).
Any idea what could be going wrong? My view is set to be an "HTML List", grouped by "Resource Type".
Not 100% sure, given that I do not have your setup to make tests, but it looks like you are experiencing this issue. On comment #16 Merlin of Chaos (the author of views) provides a patch that subsequent comments seem to confirm as "working".
If that is not the case, a workaround could be for you to sort nodes instead of grouping them. You could add the grouping header by passing to the template also the node type value: you then would add the header with the type of content by comparing with the previous one. In pseudo-code:
$type_in_use = 'xxx'
if $type_of_next_node != $type_in_use then
$type_in_use = $type_of_next_node
print_header($type_in_use)
Just an inelegant workaround, but should work!
HTH

Resources