Google analytics error message 'Unexpected error. please try again later' - google-analytics

When trying to save a filter to a GA dashboard widget I am getting the error message 'Unexpected error. please try again later'.
The widget I am having a problem with is the 'show landing pages for Facebook referrals' widget.
Here are the parameters I set...
Display the following columns:
Page title
Unique pageviews
Filter this data:
Only show 'Social source referral' Exactly matching Yes
Only show 'Social network' Exactly matching Facebook
Up to this point I can save the widget.
Now...its the following filter that is causing the problem.
Only show 'Page' Regular expression
twwdcqgfk1|u0evfggft91b|u0qpgfgfgy64z|u2lfgfgfhrnsg1|u4d5aerwwrhoz|u6mwwwrr39tiz|u8tr5hfs2st5z
The above is only a sample of the ids, I use about 450 ids in the regular expression field.
When I use this filter on other widgets in the same dashboard and in widgets of other dashboards it works fine but on a few I get the error when trying to save 'Unexpected error. please try again later'.
If I just use two ids in the regular expression field i.e. u4d5aerwwrhoz|u6mwwwrr39tiz I can save the widget with the 'page' filter - however if I add more than two ids that's I cannot save.
I can't figure it out, i've tried saving this filter using multiple browsers, on different pc's, at different times but I cant get it to work.
Any ideas?
Thanks

the reason why the report won't work is quite simple :-)
Regular Expressions — You can also use regular expressions in filter
expressions using the =~ and !~ operators. Their syntax is similar to
Perl regular expressions and have these additional rules: Maximum
length of 128 characters — Regular expressions longer than 128
characters result in a 400 Bad Request status code returned from the
server.
The workaround from my experience is to use API and run several queries so that you can stay within the limits. But it's pain in the ass...
If there is some simpler pattern -- I checked and all of the posted IDs have 13 characters, so maybe you could use regular expression checking the number of characters. Something like:
.*\?^facebookAdId=.{13}$/
The curly brackets are the way to check the number of occurrences. This could probably help.

Related

Custom Report #googleanalytics regular expressions

I am trying to create a report in google analytics which should include this /customer/account/create?signup=1&invitation_url as a part of the landing page. When I create the custom report for filters when I add
/customer/account/create?signup=1&invitation_url and use regex I am getting null values. What regex expression can I use to get this?
Basically I need all sessions from the landing page that includes
/customer/account/create?signup=1&invitation_url
You need to screen special symbols with "\".
\/customer\/account\/create\?signup=1&invitation_url
Good tool to test regex:
https://regex101.com/

How to verify a text is present on a webpage for 'n' times

I wanted to verify a text in a webpage exist for 2 times or ‘n’ times. I have used “Page Should Contain” keyword but it says “Pass” when it identifies single occurrence. I don’t want to verify using locator.
Ex: I want to verify the text "Success" is available in a current webpage for 3 times using robot framework
Any inputs/suggesstions would be helpful.
Too bad you don't want to use a locator, as robotframework has a keyword just for that:
Xpath Should Match X Times //*[contains(., "Success")] 2
The caveat is the locator should not be prepended with xpath= - just straight expression.
The library keyword Page Should Contain does pretty much exactly that, by the way.
And if you want to find how many times the string is present in the page - easy:
${count}= Get Matching Xpath Count //*[contains(., "Success")]
And then do any kind of checks on the result, e.g.
Should Be Equal ${count} 2
I thought the problem of not using locator sounds fun (the rationale behind the requirement still unclear, yet), so another solution - look in the source yourself:
${source}= Page Source # you have the whole html of the page here
${matches}= Get Regexp Matches ${source} >.*\b(Success)\b.*<
${count}= Get Length ${matches}
The first one gets the source, the second gets all non-overlapping (separate) occurrences of the target string, when it is (hopefully) inside a tag. The third line returns the count.
Disclaimer - please don't actually do that, unless you're 100% sure of the source and the structure. Use a locator.

Encoding wildcarding, stemming, etc in simple search

We have a simple search interface which calls the search:search($query-text) function. Is there a syntax to include control for wildcarding, stemming and case sensitivity within the single text string that the function accepts? I haven't been able to find anything in the MarkLogic docs.
See the $options parameter and the <term> and <term-option> constraint at https://docs.marklogic.com/search:search . There is a guide at http://developer.marklogic.com/learn/2009-07-search-api-walkthrough
and some details http://developer.marklogic.com/learn/2009-07-search-api-walkthrough#ndbba3437f320a4a4
I don't know of any existing syntax for those options, aside from the built-in behavior of turning on wildcards when a term contains '*' or '?' and turning on case-sensitivity when the term contains capital letters.
You could develop a syntax. Implementing it might involve a custom parser along the lines of https://github.com/mblakele/xqysp then feeding the resulting cts:query into search:resolve.
Piggybacking on Eric Bloch's answer... you can always dynamically construct your node based on input in the user interface.
For example, I often do this in order to separate the facet selection portion of the query from the text search portion and put the facet selection query in the additional-query element in the options node.

Scraping ASP pages with Excel/VBA

I'm trying to scrape an ASP.NET page with Excel. Unfortunately, the page only returns 50 records at a time, of several pages. Excel's native Web Query module only picks up the first page. I want all the pages.
Like most (all?) ASP pages, there are a few hidden variables sent back to the server when requesting a new page. The important ones are _VIEWSTATE and _EVENT_VALIDATION.
I've written a VBA function that gets the HTML source of the page and scrapes these variables from it.
I've also written an .iqy page, which allows for POST requests in it. It looks something like this:
WEB
1
http://www.myaspwebsite/search/search_List.aspx
__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwULLTEy[....truncated ..50k characters..]Mhudyk5U6u8%2BBpvxDPN8R4%3D&__EVENTVALIDATION=%2FwEWFQL%2FkN%2FBCgL6g%2B5vAvfY06EOAoic4qIIAome%2Bf4PAuOrjYgIAuKrjYgIAuGrjYgIAuCrjYgIAuerjYgIAt7e34UPAvuL7m8CtuLToQ4CiaTioggCyKX5%2Fg8C4tv1sAgC49v1sAgC4Nv1sAgC4dv1sAgC5tv1sAgC%2Fd7fhQ%2BU8QRtxd7MM4Bpa%2F%2FZC7I64eUh3Q%3D%3D&ctl00_RadMenu1_ClientState=&ctl00%24ContentPlaceHolder1%24NavBar1%24PageNoDropDownList=2&ctl00%24ContentPlaceHolder1%24NavBar1%24btnGo=Go&ctl00%24ContentPlaceHolder1%24NavBar2%24PageNoDropDownList=1
Selection=AllTables
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False
This iqy page successfully retuns the desired results if the post query is placed in the file.
I can also use this .iqy page programmatically in VBA and assign the POST query dynamically using QueryTables. However, I get told that my query returned nothing.
I suspect this is because of the length of my argument. The VIEWSTATE alone is about 50k characters. I've tried printing the argument string to a file and it truncates it. However, I can read the same string from a file and use it dynamically successfully.
My questions are : Am I going about this the best way? What limitations should I be aware of when doing this? Also, is there a limit to string size in Excel?
According to Microsoft's documentation on Visual Basic strings (same value applies to VBA strings):
A string can contain from 0 to approximately two billion (2 ^ 31) Unicode characters.
That is more than enough to handle a 50k string. A simple way to bypass IDE line limits and immediate window printing limits would be to print the string into an Excel cell and then read it back into a variable when you need to use that piece of data.

Apostrophe problem in multiple-select fields

I have been fruitlessly searching for a solution for the following problem in Drupal.
Making a selection in a multiple-select field (i.e. a list of checkboxes) will yield an "Illegal Choice Detected" error if any of the choices contain apostrophes. This problem is referenced here. This field exists within registration and is not generated through either webforms or CCK.
Does anyone have any exact solution in mind, i.e. specific code to add to modules, or making particular updates?
Try to use one of two php functions to generate strings:
htmlspecialchars
htmlentities

Resources