Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I try to save Web Property ID on admin/config/system/googleanalytics page, it gives me this warning. But I have my UA code in format UA-xxxxxxx. I don't know what I should insert as "yy".
Could anybody help?
Comment | File | Size | Author |
---|---|---|---|
#17 | googleanalytics.admin_.inc_.patch | 970 bytes | pverrier |
Comments
Comment #1
hass CreditAttribution: hass commentedRTFM next to the input box.
Comment #2
tomas.teicher CreditAttribution: tomas.teicher commentedThanks:)
I got it:)
Comment #4
Nighthawkdark CreditAttribution: Nighthawkdark commentedHi!
I have the same problem because my UA code is formatted as UA-xxxxxxx-y and not as UA-xxxxxxx-yy.
Any help will be must appreciated! Thanks!
Comment #5
hass CreditAttribution: hass commentedThere is no bug.
Comment #6
Didier Misson CreditAttribution: Didier Misson commentedI have exactly the same problem !
The Google Analytics module refuse my UA.
I check in Google Analytics, in the "old interface".
I can check the status of my new site :
So, my UA has a format UA- 8 numbers -1
Drupal give the error message :
Une Identité (ID) de Propriété Web Google Analytics valide est sensible à la casse et est formatée telle que UA-xxxxxxx-aa.
My UA is formated UA-xxxxxxxx-n !
I check in the javascript code generated by Google Analytics :
So, my UA is CORRECT but Drupal refuse it ...
UA-xxxxxxx-aa : requested by Drupal (7x-2)
UA-12345678-1 : provided by Google... (8x-1)
Thanks for your help.
;-)
Comment #7
hass CreditAttribution: hass commentedComment #8
Didier Misson CreditAttribution: Didier Misson commentedThanks Hass ;-)
Where must I put this PHP code ?
Thanks for your help.
Didier
Comment #9
hass CreditAttribution: hass commentedThis is the code that is used to verify ga codes for about 3-4 years and is 100% correct. Code wise, there is nothing wrong. There are 180.000 installations without any problem.
You may run a broken php version with preg_match bugs.
Comment #10
Didier Misson CreditAttribution: Didier Misson commentedThanks for reply Hass.
Our server is an Ubuntu 11.10 server, with standard LAMP installation.
I have other site and I check : other UA formats are accepted.
Strange...
Comment #11
hass CreditAttribution: hass commentedIf you can read the regex you would know that it validates for
UA-
followed by 4 or more (up to unlimited) digits, followed by a dash, followed by ONE or more (up to unlimited) digits.Comment #12
Alifbay CreditAttribution: Alifbay commentedJust to be sure did you paste the code from Google Analytics? If so, you have to change the two dashes, the copy and paste does not provide the right character.
Comment #13
hass CreditAttribution: hass commentedYou have no idea what you are talking about, isn't it? There is nothing to say any more.
Comment #14
lcligny CreditAttribution: lcligny commented@Alifbay thanks for your suggestion, I was trying to copy-paste my GA code from the Google interface since yesterday. Now I changed the dashes to normal ones and it worked perfectly.
The code was of form UA–XXXXXX–Y (wrong) instead of UA-XXXXXX-Y (good).
Comment #15
pverrier CreditAttribution: pverrier commentedHad the same issue ; thanks Alifbay (#12), you're right !
Perhaps it will be useful to automatically replace these dashes by the good ones... I'm probably not the last to copy/paste and be blocked here...
Comment #16
hass CreditAttribution: hass commentedDo you have a patch ready? :-)
Comment #17
pverrier CreditAttribution: pverrier commentedHere's a patch to automatically convert ndashes to normal ones.
Comment #18
hass CreditAttribution: hass commented#1509610: Invalid dashes in UA–xxxxxxxx–y cannot copied & pasted from Google Analytics website
Comment #19
Stephane Bouillet CreditAttribution: Stephane Bouillet commentedThank you #12 Alifbay: just so simple and both complicated ;)