Trouble Capturing Variable with Percent Encoded characters in Google Tag Manager - google-tag-manager

I am trying to log a variable in my sites url. As I understand it, in google tag manager I head over to the variables section, added a user defined variable as follows:
Variable Type: URL
Component Type: Query
Query Key: search_location_address[text]
(I have also tried search_location_address%5Btext%5D as it appears in the url)
URL Source: Page URL
Neither version of the query key seems to work, when previewing and testing, the Location variable shows up as undefined.
Shows Undefined Location
Any ideas or am I completely missing something here?

Related

Linkedin API V2 query by VanityName with ampersand doesn't work

Working example: https://api.linkedin.com/v2/organizations?q=vanityName&vanityName=apple
Basically this is working for any other company, except if it has a & in the name, for example:
cannot use this vanity name (doesn't seem to be a url encode problem on the client side):
johnson-&-johnson or johnson-%26-johnson
The error is always the same:
serviceCode: 100
status: 403
message: Unpermitted fields present in PARAMETER: Data Processing Exception while processing fields [/-johnson]
This is not a permission problem, its working with any other vanity name.
In the response the uri seems to be messed up: https://api.linkedin.com/v2/organizations?-johnson=&q=vanityName&vanityName=johnson-
It should equal the request which is https://api.linkedin.com/v2/organizations?q=vanityName&vanityName=johnson-%26-johnson.
Also documentation doesn't seem to mention this use case.
Some other examples that work
https://api.linkedin.com/v2/organizations?q=vanityName&vanityName=johnson-controls-middle-east-africa
https://api.linkedin.com/v2/organizations?q=vanityName&vanityName=lowe's-home-improvement

Google Analytics Replace Homepage URL as "/" to Something Else

I'm looking to find a way to replace the home page URL that Google deems as "/" in my Google Analytics reports. I know Google sets "/" as the home page but in my reports, I want it to display "Home" instead.
I haven't found any solutions through Google. I'm thinking it's through filters somehow.
I've tried going through the GA settings and did a search on filters how to change this but no solutions. Thanks!
Although I would not recommend this, you can create a filter in a view (possibly not the default one as it's bad practice) with the following fields:
Regex explaination:
^ asserts position at start of a line
\/ matches the character / literally
$ asserts position at the end of a line
Filter configuration if the SS gets lost:
Filter type: Custom
Checbox: Search and Replace
Filter field: Request URI
Search string: ^(\/)$
Replace string: Home
Remember to verify your filter and to create an additional view if you do this.

Getting RefererNotAllowedMapError from GAPI whereas the restriction pattern defined seems to match the referring URL

A.S/ probably for another SE.com site: why "referer" is spelt with only r at Google's?
Anyway, here we go again with another occurrence of RefererNotAllowedMapError.
I couldn't find my answer in the existing Q&As.
Hypothesis:
I have a local website that includes a GMap.
It displays and works
fine provided I remove all restrictions on that key, from the Google
API console.
But the browser will receive a Google Maps JavaScript
API error: RefererNotAllowedMapError whenever I add a referrer
restriction, which seems to match the refering URL.
The referrer, where the map is being called form, is:
https://app.developr.online.local/projects?p=name-asc-0-20-1&a=createProject
Below is my GAPI KEY security configuration:
Below is the corresponding console output:
To be noted:
If I add a trailing asterisk when declaring the referer, validating that entry will clear it anyway. To me it means: "that's ok, we're covering trailing /* already.".
My question: what pattern should I enter as a referrer (2 r's) to have it recognised by GAPI security layer?
I've tried a few things, I didn't get a cigar.
Thank you.

How to set-up trigger only to Homepage - google tag manager

how I can set-up trigger to fire only on Homepage? We´re using also UTM parameters so condition URL Path equals http://website.com is not working.
Thank you!
Create a JavaScript variable in Google Tag Manager to return the value of document.location.pathname
This variable will contain the value of the current URL path, without any URL parameters or fragments.
You can then set your homepage trigger to fire when the value of your JavaScript variable equals /
Pattern for a homepage usually would be ^/$. In human language it means “starts and immediately ends with /”.
As URL variable contains domain name and possible query parameters (that is what goes after ?), better to use Page Path (Make sure you have it enabled in your GTM Account, under Variables > Enabled Built-In Variables).
http://www.apasters.com/blog/regex-guide-google-analytics-tag-manager/

Tracking a change of web directory in Google Analytics

We recently changed the directory structure for our website. For example the following page was listed changed as follows:
Previous: /degrees/msm-technology/
Current: /degrees/masters/ms-management/technology/
They are the same directory with the same pages just listed differently.
I'm attempting to do a custom filter Search and Replace to update the previous page so that there is not an interruption in data when tracking the pages. However it doesn't seem to be working.
Filter Field Request URI -
Search string ^/degrees/msm-technology/
Replace string: /degrees/masters/ms-management/technology/
The data for the previous page listed ends this week, while the other begins.
You need to escape the hyphen like this
Search string: ^/degrees/msm\-technology/
because GA filters use POSIX Regex.
[source: https://support.google.com/analytics/answer/1034836?hl=en]
Hope this helps.

Resources