Lookup Table Input Variable Issue - google-tag-manager

I am using a lookup table to successfully apply different UA-ID codes to the same universal analytics tag. However, for one particular UA-ID, I need to send data from all pages with the exception of data from a particular sub domain. i.e. something like this:
input variable : *.example.com except abc.example.com
Not sure how to implement this logic for the input variable of a lookup table.
Also, if I specify "example.com" as an input variable, does it capture all subdomains?

Edit in Jan 2018 for latest info.
For lookup tables you need to know 2 things:
Lookup table input variables do a hard match. I.e. its simply an 'equals' only, no 'contains' or 'starts with' or regex etc.
Lookup tables are sequential, the matching starts from the top and stops as soon as a match is found. Much like an if then elseif (without an 'else' available at the end!)
You can apply a default value if none of the rows in the table match.
There are now Regex Tables available as well which will enable you to do partial matches on values and return a value based on that. For full and comprehensive details, read the article by Simo
In your case you have 3 options:
Use a Regex Table Lookup
list each and every hostname (inc subdomain) you want to match and apply the correct UA number to each. You should end up with as many lines as you do sub-domains.
Create a new custom javascript variable which inspects the current host (inc subdomain) and returns whether its 'abc.example.com' or '.example.com' (indicating any other sub domain) and then you'll just need a couple of lines in your lookup table.

Related

check duplicate values in oracle forms multi record block

What I wanted is to display an alert when I move to the next row if the record that I inserted is already one of the records in the multi record block.
and in what trigger must I put it?
There are several options you can use.
One is to POST values entered (in WHEN-NEW-RECORD-INSTANCE) trigger. It will, well, post everything you entered so far. Then, you can write a WHEN-VALIDATE-ITEM trigger which SELECTs from that table and checks whether such a value already exists. Alternatively, if there's the UNIQUE CONSTRAINT on that (those) column(s), database will do its job itself, i.e. raise an exception.
Another option is to literally loop through all rows in a block and compare the first row's value with all the others, then the second row's values with all of them, etc.
Or, you can use a Record Group (usually used for Lists of Values). Basically, you'd check whether value you entered exists in a record group. More info, along with a FMB file, on Craig's blog.
Or, you can use calculated items, as described enter link description here (FMB attached as well).
As you can see, quite a few ways to do that; explore each of them and pick the one you find the most useful / attractive / easy to implement.

Google Analytics API - filter dimension sourceMedium

I would like to filter certain sources and mediums (specifically email clients). I need to keep the dimension as one column (I use the maximum number of dimensions - 7).
The filter works fine when I have only one sourceMedium such as:
ga:sourceMedium!=amail.centrum.cz / referral
Filter doesn’t work at all when I use two sourceMedium:
ga:sourceMedium!=amail.centrum.cz / referral,ga:sourceMedium!=mail.google.com / referral
It doesn’t matter If I use AND / OR, the query doesn’t output the desired data.
I assume that there supposed to be some delimiter which could identify that amail.centrum.cz is one string which is delimited by another one. I already tried to use ' at the beginning and at the end of the string, but it seems that it doesn’t work.
Is there anything that I missed in docs or anything else? Looking for your help :)
BTW: I'm aware of the solution: Pull out data from GA, filter data manually (compare output data vs my list of email clients what I would like to exclude)

Google Tag Manager LookUp of LookUps Output Values

I have grouped four sets of landing pages into four corresponding LookUp Table variables, using {{page path}} as the input variable. I've applied an output value for each landing page within each of these groupings.
I group the above variables into another LookUp Table variable (basically a LookUp of LookUps), and use this in an all-pages pageview tag to populate a Google Universal Content Grouping.
My question is whether I need to apply an output value to each input in the LookUp of LookUps?
Asked differently -- since output values are applied to each input in the four landing page lookups, will these pass through to the lookup of lookups, or do I need to apply output values there, too?
In short, the approach above cannot work. It requires GTM variable values to change (as values go from the set of lookups to the 'lookup of lookups'), but they're not meant to chance. A variable is meant to either represent a value, or not.
I wound up inserting dataLayer variables into the landing page code to apply the needed page-by-page designations.

Using filters to track hits for multiple URLs

We have a large website that is split up into groups of organisations with a number of micro-sites. We would like to provide one organisation within a group with their own set of data and I am having troubling getting the filtering working.
I think my main problem is I have 2 include filters. According to the documentation:
"If you apply multiple Include Filters, the hit must match every applied Include Filter in order to save the hit."
Our website urls would go something like this: https://[host]/[group]/[site]/[params]. I would like to track the following, given that this client (id 9) is in group "foo":
https://mysite.com/foo/live/default.aspx?id=9
https://mysite.com/foo/live/?id=9
https://mysite.com/foo/reporting/9/*
so that any hits on those urls would be captured for this particular client.
Our 2 current filters (type="Include") are as follows:
/foo/Reporting/9/
/foo/[^\?]*\?id=9
but these do not seem to track everything we think they should. Any help would be much appreciated.
By the time the first filter is done there is nothing left for the second filter to match - the first filter throws everything away that does not match (that's what Google means by "the hit must match every applied Include Filter").
I would suggest you first use an advanced filter to transform your urls so they follow all the same pattern (i.e. grab the value from the query parameter and append it to the url path) and then apply the include filter. I'm pretty certain that would be easier than trying to include different url structures (if you need help with the filters holler away in the comments, but the example given in the advanced filters interface should give you a clue how this works).

How can I get results for a dimension (custom variables), where the value is not set?

I am using custom variables to track order ids. In order to aggregate analytics data into out data warehouse, I want to select a number of metrics with the custom variable as a dimension. However, if I do so, I will not get the entries where the variable is not set (E.g. sessions that didn't result in a sale). I need to get these as well.
Can I write a filter or segment that selects only the entries that doesn't have a particular custom variable? I have tried:
segment=dynamic::ga:customVarValue1==
But that doesn't seem to work (It gives no results back).
Basically I'm looking for the equivalent to where ga:customVarValue1 is null in sql.
In short, it's not possible to get the nullset data, as explained by a Google rep:
For some dimensions, GA uses the default value of (not set).
Custom Variable do not have a default value, so if a hit does not have a
custom variable associated with it, all the other dimensions in the query
are not added to the reports.
The original answer is a little confusing, but when you read between the lines it suggests that they throw out these "empty" values when they run their aggregates.
The "correct" approach, as he explains, is to set a default value for any row you want reported:
If you need to see the (not set) value, you could try sending a default
value for custom variables.
For example if you use visitor level custom vars to track member vs
non-member, you should always set non-member as a default for everybody;
then modify to member once they register.
Details are here: http://groups.google.com/group/google-analytics-data-export-api/browse_thread/thread/cd078ddb26ca18d5?pli=1
I've just had some success solving this by using a Regex to capture users or sessions where the custom dimension has no value. In my case I want to separate logged in and logged out users.
The Regex .+ will capture any non-empty value, so can be used to get the job done.
The filters for my Returning users segment is matches regex: .+ like this:
For the Customer prospects I used: does not match regex: .+ like this:
It's early days, but this appears to be working:

Resources