AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

5.1K members online now
5.1K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
Guide Me

linker:autoLink, decorateForm and useAnchor both set to true doesn't work

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have run into what I think is a bug. in the linker script as documented here:

I have set both useAnchor and DecorateForm to true, however when the form is submitted, the client id is not placed in the anchor portion. The documentation seems to indicate that it should.

My GA script:

      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

      ga('create', 'UA-8963314-1', 'auto', {'allowLinker': true });
      ga('require', 'linker');
      ga('linker:autoLink', ['',''],true,true);
      ga('send', 'pageview');

My very simple test form:

<form id="testform" action="" method="get">
<input type="text" name="hotel" value="10337">
<input type="submit" value="submit">

The resulting url with querystring:


I believe it should be:

You can try it for yourself here:

Thoughts? Am I doing something wrong or is this a bug or am I misunderstanding that it's possible?

Re: linker:autoLink, decorateForm and useAnchor both set to true doesn't work

Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭
Hey Margaret,

this is working correctly!

Dont get bogged down by '&' vs. '#' so much... You're fine, as long as "_ga" parameter is appended to the destination URL, with correct client ID information. In-fact it's good its not an anchor '#' parameter, because to the best of my knowledge, GA strips off everything in the URL after '#' '

You can further confirm from Real Time reports, as you fsubmit the firm, the reports should display 1-user, 1-session, 2- pageviews (otherwise it'll show 2-users, 2-sessions-2-pageview.

Hope this helps,


Re: linker:autoLink, decorateForm and useAnchor both set to true doesn't work

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thank you for your reply! The problem is that our booking engine requires the # in front of the _ga parameter. A form submission to them has to look like this:

If I send it with an ampersand instead of a hashtag, then it generates this error: "Illegal PLSQL identifier in input"

I can use javascript to concatenate the querystring with the post object, a hashtag, then the client ID, of course, but it does seem like I shouldn't have to do that. The documentation on linker:autoLink looks to me like it can put the client id in the anchor portion of the url (after a # sign) when decorating a form.

linker:autoLink, decorateForm and useAnchor both set to true doesn&#39;t work

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

@Vibhor J The problem is that the website configuration can require this information to be sent to the anchor portion of the URL rather than the query portion.


I have the same issue on a website where adding the _ga parameter in the query portion causes a loading error.


@Margaret P Did you finally managed to add it to the anchor portion?