I would like to create a filter in Google Analytics, to exclude the following pages:
-- All the pages with names starting from "temp" in the directory mydomain.com/articles/
-- all the pages with names starting from "tmp" in directory mydomain.com/units/
What filter field and pattern do I need?
You should use two exclusion filters with regex maching.
URI of request:
/articles/temp(.*)
/units/tmp(.*)
Related
I would like to ask how could I exclude unwanted referrals from GA4 and Firebase? In my particular case, I would like to exclude checkout.stripe.com from purchase event sources.
I've added checkout.stripe.com to the unwanted referral list (Data Streams -> More tagging settings -> List unwanted referrals)
and specified my domain (Data Streams -> More tagging settings -> Configure your domain).
However without a satisfactory result - still each purchase conversion is assigning to checkout.stripe.com
To configure GA4 in my project I'm using the Angularfire library.
OK, I know how to fix it.
To filter unwanted referral from GA4 use domain instead subdomain. So in this particular case the proper configuration the "Match type" is "contains" and the domain field to "stripe.com".
How can I exclude posts from the search endpoint in WP REST API?
I have:
'/wp-json/wp/v2/search?s=lorem&page=1&per_page=60&_embed&exclude=1392
where 1392 is the ID of excluding page, but it does not work...
https://developer.wordpress.org/rest-api/reference/search-results/
I can't pass exclude parameters to search results, but I have to exclude some posts from the WordPress search.
Anyone know how can I do that?
Thanks!
The exclude is an array, so to exclude the first post use exclude[0]=1392, to exclude a second post: exclude[1]=333
The test that worked for me uses this structure which is different to yours:
'/wp-json/wp/v2/posts?search=lorem&exclude[0]=1392'
Please note if you pass all the exclude ids through an array, the REST API will generate the exclude parameters positions for you.
I have been working on integrating GTM and GA to my website, using Environment Variables to setup GA Property Views for different setups.
I found similar solutions in various blogs, i.e., by setting up Lookup Tables or RegEx Table, with lookups for GA-Tracking-ID.
ISSUE
Lookup Tables adds a prefix vtp_ to the keys present in default GA-settings obj, as shown below:
Due to this, GA doesn't work.
If I use the GA Settings Variable directly, Everything works fine.
This happens on current Dashboard Setups for GTM and GA.
You cannot use a Google Analytics Settings variable as the output of a Lookup Table variable for a simple reason:
The "Google Analytics Settings" field in a tag is the only place where you can use a Google Analytics Settings variable, and it is the only type of variable you can use there.
In other words, if you create a Lookup Table variable that returns Google Analytics Settings variables, there's no place to add that variable to, since the only valid place would be the Google Analytics Settings field which, as noted above, doesn't accept Lookup Table variables.
Trying to add the Lookup Table into the "Tracking ID" field, for example, is a mistake, since the table returns a Google Analytics Settings object rather than a valid tracking ID.
i had the same issue, and i was mapping the lookup values to variables of type google analytics settings:
i changed them to strings then it started working:
Here's how I did it successfully with Dev and Live environments setup.
Enable Environment Name in Built-In Variables
Create a Lookup Table variable in User-Defined Variables as GA Tracking ID - ENV
For the Lookup Table row, change it accordingly. In my case, my environments are only Dev and Live so I put it there.
Create a Google Analytics Settings variable in User-Defined Variables
For the Track ID, select the GA Tracking ID - ENV - that's all the variable config for this to work in minimum.
Then Create a Tag for the Google Analytics
Make sure to select the Google Analytics Settings created.
My goal is to create a Google Analytics filter that "includes only" 2 host names.
For example, include only:
www.example.com
www2.example.com
The desired result is that Google Analytics reports display traffic only from www.example.com and www2.example.com.
Is there a way to accomplish this?
Yes you can do this by seperating sources with pipe "|"
example\.com|example2\.com|.*example3\.com
Here is Google documentation:
Include Filters are applied with the reverse logic. When you apply an
Include Filter, the hit is thrown away if the pattern does not match
the data. If you apply multiple Include Filters, the hit must match
every applied Include Filter in order to save the hit. To include
multiple patterns for a specific field, create a single include filter
that contains all of the individual expressions separated by '|'.
Check these links for more information
https://support.google.com/analytics/answer/1034832?hl=en&ref_topic=1034830
https://support.google.com/analytics/answer/1034842?hl=en
I have two domains, a .nl and a .be domain. Both have their own Google Analytics IDs. Currently I have the analytic code on the website and, depending on the domain, the correct ID is inserted into the code. The tracking works correctly on both sites.
Now I want to implement the Google Tag Manager, to get more flexibility for Javascript.
The struggle is now how get to the same result, without implementing the Google Tag Manager twice (or more if more domains are added).
How can I achieve this? I tried with the rules in combination with a regex on the {{url}}, but without any success.
The best way if you want to prepare for more domains would be a lookup table macro.
First create a url type macro that return the hostname. Then create a macro of the type lookup table - that is a macro that returns a value based on the value of another macro. It should look something like this ( {{url hostname}} is the macro that holds, well, the hostname) :
Then insert the macro name ( {{Google ID}} in the example in the screenshot) in the "Tracking ID" field in you Google Analytics Tag and it will be set according to the domain name. If you want more domains just add a row to the lookup table.