Jump to content

iwato

Members
  • Content count

    1,321
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by iwato

  1. iwato

    Juggling Dimensions in Responsive Design

    dsonesuk: What is obvious to you is not obvious to me. I have taken your suggestion with regard to the negative margins and the appropriate place to change the width of my middle panel as suggested by the Furtive Fox. All of this combined has mostly resolved the problem of the middle section on my computer's Firefox and Chrome browsers when the width of the viewport is changed. You can check the results by opening to the Grammar Captive mainpage and clicking on the About and Free Consultation menu options under the heading Introduction in the navigation bar. What I have sacrificed in so doing, however, is the alignment in my Safari browser on my iPhone for the same main div panels and other similarly constructed main div panel inserts. Now, perhaps you can better understand what I meant by the title word Juggling. Surely, this problem can be overcome without my having to redesign my entire webpage. Well, at least, it is my hope. Roddy
  2. iwato

    Juggling Dimensions in Responsive Design

    OK, Dsonesuk, it fixes the problem in my browser window, but creates a problem on my iPhone. Is there a way to achieve the same goal on both apparati? Roddy
  3. iwato

    Javascript Timing

    Is it possible for the Matomo application to trigger the Javascript? Let me provide a more concrete example of what I mean. On the Grammar Captive mainpage is a standard Matomo tracking script that appears as follows: <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//.../matomo/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> Indeed, the above script is on every webpage whose visitor behavior I wish to track. On the mainpage in particular various events are triggered using Javascript after the page has loaded. Each of these events includes a piece of code similar to the following: _paq.push(['trackEvent', 'Gate One', 'Click', fileName]); The consists of the pushed array element consist of a Matomo method called trackEvent(). Associated with each such event are three parameters used to identify the event. Now, with the exception of the four standard Matomo methods that fill the _paq array when the page is first loaded, every additional event triggered by Javascript and containing a _paq.push({...}); statement occurs after the page has been loaded. Does this imply that these latter events will not be properly tracked unless I reload the first script with each and every new triggered event? Roddy
  4. iwato

    Juggling Dimensions in Responsive Design

    OK. It appears that I have been able to salvage my intended format with a minimum of secondary, negative effects. What I cannot seem to achieve, however, is uniformity in width among my center panels. Please perform the following experiment. The EXPERIMENT After opening to the Grammar Captive mainpage proceed to the navigation bar and find two menu options: About and Free Consultation! Click on each and notice that the background color does not fill across the entire width of the center panel. QUESTION: What is prohibiting the background color from filling the entire width of the center panel? Roddy
  5. iwato

    Juggling Dimensions in Responsive Design

    Your observation makes good sense until I try to adjust the following media rule to accommodate for the gap. It has no effect. /* for 700px or less. Note: It was previously set to 600px. */ @media screen and (max-width: 700px) { #content { width: auto; float: none; } #middle { width: auto; width: -moz-auto; float: none; margin-left: 0px; } #sidebar { width: auto; width: -moz-auto; float: none; } }
  6. iwato

    Inserting a Higher Software Version

    OK. Then you appear to agree with the following: But then, how would you interpret the meaning of {list: list} in the above statement? Is the first list the name of an object property called list, and the second list an array called list of the form [['foo', 12], ['bar', 6]]. Is it just this simple? Roddy
  7. iwato

    Inserting a Higher Software Version

    Yes, but what is the format of the resulting list? 1) Is it pairs of elements separated by commas in a single line. [count] [search string], [count] [search string], [count] [search string], ... [count] [search string] \n 2) Is it pairs of elements separated by line breaks? [count] [search string] \n [count] [search string] \n [count] [search string] \n ... [count] [search string] \n Also, how does Javascript recognize a list as a list? Is everything closed in parantheses? Is there a special method that constitutes a list from either of the above two formats. Then too, what happens, if the search string is composed of multiple words? It is not as simple a problem, as it would first appear. Well, at least not for me, at any rate. Roddy
  8. iwato

    Inserting a Higher Software Version

    No, I have not forgotten. Simply, I believe that I have found a way to avoid the problem. Use a technique that does not depend on jQuery. BACKGROUND: I have discovered a Javascript package called wordcloud2.js. In order to run this I need to create a list. in preparation for this moment I have managed to create an array of objects from the Matomo database that contain the information needed to create the list. Each object in the array takes the following form: category: "Site Search / [category]" count: "[number]" target: "[search string]" where the information contained in the brackets are the values of the respective properties of each object. The array takes on the following appearance: array {object, object, object, ..., object) THE GOAL: Create a list of the following format. [number] [search string] [number] [search string] [number] [search string] ... [number] [search string] DILEMMA: Now, there is plenty of information about how to create objects and arrays from lists. I need to know how to do just the opposite. Roddy
  9. BACKGROUND: While I continue to struggle with my wget problem, I would like to reaffirm a discussion that we had already two or three months ago about the use of hash marks in an HTTP Request query string. Please consider the following HTTP Request copied from a Matomo API request generated by Matomo. I only initiated the request, I did not create it. https://www.nudge.online/_utilities/php/matomo/index.php ?module=CoreHome &action=index &idSite=1 &period=day &date=yesterday #?idSite=1 &period=day &date=yesterday &category=General_Actions &subcategory=Actions_SubmenuSitesearch Is it not likely that the above request is one request riding piggy-back on another that upon arrival get split and are made into two separate requests? If my interpretation is indeed accurate, then why make the initial request at all, as it appears to add no new information. Why not just write and send the following: https://www.nudge.online/_utilities/php/matomo/index.php ?module=CoreHome &action=index &idSite=1 &period=day &date=yesterday &category=General_Actions &subcategory=Actions_SubmenuSitesearch Any ideas? Roddy ps: I know it seems silly to have to post these questions at W3Schools, but this reflects the desert of support that Matomo offers while making its software free to the general public. Although it is surely true that beggars should not be choosers, how can one possibly expect to promote one's software without providing even the most minimal support needed to make it work!
  10. iwato

    A Matter of Scope

    Thanks, JMRKER! I have copied your script into my Javascript notes. It will make it easy to remember, should I ever forget. :-) Roddy
  11. iwato

    A Matter of Scope

    GENERAL QUESTION: Can variables created outside of a function be used within a function without having to read them first as arguments of the function? If so, can a function created within a function use a variable created outside of both functions? CODE var dataString = 'search_input=' + search_letter_input; $.ajax({ type: "POST", url: './...', data: dataString, dataType: 'JSON', statusCode: { 404: function() { alert( "Page not found" ); }}, success: function(jsonData) {...} }); SPECIFIC QUESTION: I would like to use the value of the variable search_letter_input in the success function of the $.ajax( ) method. Is this possible? Roddy
  12. BACKGROUND: Having upgraded my server I now have full command of the UNIX terminal. Although a good thing, my first attempt to make use of it has failed. The following code was used to access the Matomo application which resides on the same Lunarpages VPS server as the PHP routine that calls it -- albeit from a different domain name. The CODE: <?php ini_set('log_errors', 1); ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log'); ini_set('html_errors', 0); ini_set('display_errors', 0); error_reporting(E_ALL); exec('wget --http-user=[...] --http-password=[...] -P /tmp/ -p -k https://.../index.php?module=Widgetize&action=iframe&containerId=GoalsOverview&widget=1&moduleToWidgetize=CoreHome&actionToWidgetize=renderWidgetContainer&idSite=1&period=day&date=yesterday&disableLink=1&widget=1&token_auth=[...]'); ?> When I examine the Response panel in the Network Menu of Firefox, nothing appears. This said PHP does not complain and the Headers panel returns an HTTP Request code of 200. When I run the same wget command in terminal I am able to generate an HTML file, but the contents tells me that the Matomo API responsible for generating the desired widget is not accessible. The error message reads, Any suggestions? Roddy
  13. iwato

    A Matter of Scope

    No, i have not. I thought I would check first, before I start writing. The variable is declared earlier in the routine. I will try it now. Thank you! Roddy
  14. iwato

    Matomo - A Mixed Blessing?

    BACKGROUND: It would be a long exercise in the grammar of the English language to explain what you can more readily understand by going directly to the relevant pages for which I provide the needed annotation below. gate7.html On this page you will find code that is identical in structure to six other pages similarly organized but with different content called gate1.html, gate2.html, gate3.html, gate4.html, gate5.html, gate6.html. The Javascript on this page and the other aforementioned pages performs two important functions: one, call a jQuery plug-in called $.colorbox that creates a gallery of iframes; and two, send an HTTP request to the Matomo application signalling a change of iframe. In addition, the gallery in question consists of four pages called gate7a.html, gate7b.html, gate7c.html, and gate7d.php. It should be noted that the other aforementioned six pages including gate1.html through gate6.html all perform similar tasks using nearly identical code. What makes gate7.html is the extension of the last iframe that it calls -- namely, gate7d.php. None of the other pages call an iframe with a PHP extension. overview.html After landing on this page you will find in the navigation bar on your left several options under the subheading Visitor Profile. I would like to draw your attention to two of them -- namely, Event Profiles and Splash Panel. These two panels report similar information obtained from the Matomo database -- albeit via differently constructed PHP cURL calls. Event Profiles: Once the panel fills, click anywhere where it says by Category and what will appear is an entry for all of the seven gates, but the one in question. Splash Panel: Click on any of the items under the heading By Category, and you will discover the same. The absence of data for the Gate Seven gallery. Click on any of the items under the heading By Named Event, and you will discover that the Javascript for Matomo is collecting the desired data. Indeed, you will find listed gate7a, gate7d, and title 7; all of these pages are tracked with the same category tag -- namely, Gate Seven. CAUTION: The Matomo application is extremely slow in my current server environment. You must be patient for the data to fill. Soon, I will have upgraded to a scalable cloud with my own dedicated IP address, and this problem is expected to go away. Also, note that the splash panel consists of some 47 individually constructed webpages eight of which contain Javascript using the same $.colorbox plug-in. INSTRUCTION: After you load the overview.html page open your web console. Then, click on the heading Splash Panel under Visitor Profile, open your Network tab in your web console, and look for a file called sevengates_splashpanel.php. Check the AJAX parameters sent to this page and notice that Gate Seven is among them. Then, check the pages Response section and notice the format of the 21 returned items. The pattern object, object, array occurs six times. For the last three items -- what should contain the information from Gate Seven -- are three empty arrays. QUESTION: How would you explain the aforementioned anomaly of three empty arrays? Roddy
  15. iwato

    Matomo - A Mixed Blessing?

    The bizarre character has magically disappeared, but with not without a trace. For, I now see where a correction that I made in regard to the coding of the Gate Seven webpages has likely made a difference. For now, Gate Seven is working appropriately, but the Gate Seven data still appears under Gate Two. I will likely have to go into the Matomo database and remove it manually. The magical nature of what has occurred is apparently created by a Matomo time lag. What it calls today is actually yesterday. Another Matomo mystery that I will someday have to address. In any case, I am not as bad a coder as I sometimes think myself to be. Then too, it was never my goal to become one. I am becoming one by default. If Grammar Captive does not sail, then I can write code manuals and help others to overcome the frustration that Matomo has created for me. Have a great day! And, once again, thank you for your patience. Roddy
  16. iwato

    Matomo - A Mixed Blessing?

    Yes, in part. The matter, however, is more complex. It is not only that the arrays for the Gate Seven query are returned empty, but that they are returned at all. For, the queries for each of the other gates return two objects and an array, rather than three arrays. Then, there is the more recently discovered confusion about the queried data: although a portion of the data for Gate Seven is returned, it is returned with the query for Gate Two. It is all too bizaare! Roddy
  17. iwato

    Matomo - A Mixed Blessing?

    Yes, the code and the associated URL and query string are what create the series of objects and arrays in the uniform pattern expected up until the data for Gate Seven is requested where upon three empty arrays appear instead of two filled objects and one filled array. Please follow the links that I provided and read my commentary else you will be stabbing in the dark. Roddy
  18. iwato

    Matomo - A Mixed Blessing?

    Some new light has been shed on the problem! By sorting the gate categories and named events by gate number in the Visitor Profile / Splash Panel I have discovered that the files related to Gate Seven appear exclusively with those of Gate Two and that the data associated solely with gate7.html is missing. Roddy
  19. iwato

    Matomo - A Mixed Blessing?

    <?php ini_set('log_errors', 1); ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log'); ini_set('html_errors', 0); ini_set('display_errors', 0); error_reporting(E_ALL); if (isset($_POST['methodName'])) { /***************************************************** The set_url_request() Function *****************************************************/ function set_url_request($method, array $params, $event_category) { $request = "method=" . $method; $segment_str = ''; if ($event_category == '') { foreach ($params as $param) { $request .= "&" . $param; } } else { (string) $segment_str = "segment=" . $event_category; array_push($params, $segment_str); foreach ($params as $param) { $request .= "&" . $param; } } return rawurlencode($request); } /***************************************************** Intialization of Key Variables *****************************************************/ $result = ''; $query_str = ''; $i = 0; $token_auth = '...'; $segment_str = ''; $categories = array(); $event_category = ''; $params = array(); /***************************************************** Event Segmentation *****************************************************/ if (isset($_POST['eventCategory'])) { foreach ($_POST['eventCategory'] as $event_category) { $event_category = filter_var($event_category, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH); $event_category = "eventCategory==" . $event_category; foreach ($_POST['methodName'] as $method) { $method = filter_var($method, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH); if ($method == '_getCategory') { $method = "Events." . substr($method, 1); $params = array("idSite=1","period=year","date=today","expanded=1"); $query_str = set_url_request($method, $params, $event_category); $sub_url .= "&urls[" . $i++ . "]=" . $query_str; } if ($method == '_getAction') { $method = "Events." . substr($method, 1); $params = array("idSite=1","period=year","date=today","expanded=1"); $query_str = set_url_request($method, $params, $event_category); $sub_url .= "&urls[" . $i++ . "]=" . $query_str; } if ($method == '_getName') { $method = "Events." . substr($method, 1); $params = array("idSite=1","period=year","date=today","expanded=1"); $query_str = set_url_request($method, $params, $event_category); $sub_url .= "&urls[" . $i++ . "]=" . $query_str; } } } $url = "https://...index.php"; $url .= "?module=API"; $url .= "&method=API.getBulkRequest"; $url .= "&format=json"; $url .= "&token_auth=$token_auth"; $url .= $sub_url; } // echo $url; /***************************************************** Send the Bulk Request *****************************************************/ $curl_request = curl_init(); curl_setopt($curl_request, CURLOPT_URL, $url); curl_setopt($curl_request, CURLOPT_RETURNTRANSFER, true); $result = json_decode(curl_exec($curl_request)); if(curl_errno($curl_request)) { echo 'Curl error: ' . curl_error($curl_request); } curl_close($curl_request); /***************************************************** JSON Encode the Returned Request and Display It *****************************************************/ echo json_encode($result); } ?> Roddy
  20. iwato

    Matomo - A Mixed Blessing?

    If you can find something wrong with it I would be grateful. I can see nothing. I will even reproduce the value of the $url variable for you. https://.../index.php?module=API&method=API.getBulkRequest&format=json&token_auth=...&urls[0]=method%3DEvents.getCategory%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20One&urls[1]=method%3DEvents.getAction%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20One&urls[2]=method%3DEvents.getName%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20One&urls[3]=method%3DEvents.getCategory%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Two&urls[4]=method%3DEvents.getAction%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Two&urls[5]=method%3DEvents.getName%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Two&urls[6]=method%3DEvents.getCategory%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Three&urls[7]=method%3DEvents.getAction%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Three&urls[8]=method%3DEvents.getName%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Three&urls[9]=method%3DEvents.getCategory%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Four&urls[10]=method%3DEvents.getAction%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Four&urls[11]=method%3DEvents.getName%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Four&urls[12]=method%3DEvents.getCategory%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Five&urls[13]=method%3DEvents.getAction%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Five&urls[14]=method%3DEvents.getName%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Five&urls[15]=method%3DEvents.getCategory%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Six&urls[16]=method%3DEvents.getAction%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Six&urls[17]=method%3DEvents.getName%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Six&urls[18]=method%3DEvents.getCategory%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Seven&urls[19]=method%3DEvents.getAction%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Seven&urls[20]=method%3DEvents.getName%26idSite%3D1%26period%3Dyear%26date%3Dtoday%26expanded%3D1%26segment%3DeventCategory%3D%3DGate%20Seven Roddy
  21. iwato

    Working with the Matomo Cookie

    OBJECTIVE: Suppress my site's splash panel for repeat visitors using a mechanism similar to the one that I use to suppress the panel for visitors whose viewports are too small to handle it properly. BACKGROUND: As I have instructed Matomo not to recognize me when I access the application I have no way of testing whether my code is working. According to a friend who has experimented with his own computer it does not. Although I am able to retrieve the cookie set by Matomo, I am now uncertain about how to handle it. NOTE: The cookie that Matomo appears to set is not set until the page has The COOKIE Sent by Matomo Array ( [_pk_id_1_28d8] => b1dccabc0123a611.1529214805.24.1530731060.1530731060. [_pk_ses_1_28d8] => * ) The PHP that Recovers the COOKIE and Assigns It to a Javascript Variable if (isset($_COOKIE['_pk_id_1_28d8'])) { $cookie_set = 1; } The JAVASCRIPT on the Same Page as the PHP var cookie_set = <?php echo $cookie_set;?>; The JAVASCRIPT on a Loaded Script Page that Controls the Splash Panel if ((!refer_type && !navtype && (viewportWidth > 360)) || !cookie_set) { [the code that sets the splash panel] } QUESTION: Can you see anything in the above logic or design that could be showing the splash panel when it is not desired? Roddy
  22. iwato

    Working with the Matomo Cookie

    So, the following statement is true. Is this not correct? Roddy
  23. BACKGROUND: Having recently learned about localStorage and familiarized myself with its methods I would now like to apply it as suggested by one of W3Schools' mentors for the purpose of identifying return visitors. Searching on the internet turned up little that was very satisfying. QUESTION: Is there a standard routine for identifying return visitors or must I develop my own? Roddy
  24. iwato

    A Matomo Bulk HTTP Request

    REQUEST: Please compare the following PHP code with the intended result, and if possible, say why only the last urls[ ] parameter is being read. BACKGROUND: The following code is part of a successfully received and partially processed HTTP POST Bulk Request to the Matomo application. Both of the called methods -- namely, Events.getCategory and Events.getAction -- have been tested separately and are perfectly functional. Further, the Matomo application reports no dysfunction, and there are no warning, notices or other indicated sources of foul coding in the PHP log file. $result = ''; $query_str = ''; $i = 0; $token_auth = '...'; function set_url_request($method, $params) { $request = "method=$method"; foreach ($params as $param) { $request .= "&" . $param; } return rawurlencode($request); } $url = "https:/.../index.php"; $url .= "?module=API"; $url .= "&method=API.getBulkRequest"; $url .= "&format=json"; $url .= "&token_auth=$token_auth"; foreach ($_POST['methodName'] as $method) { $method = filter_var($method, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH); if ($method == '_getCategory') { $method = "Events." . substr($method, 1); $params = array("idSite=1","period=year","date=today","format=json"); $query_str = set_url_request($method, $params); $url .= "&urls[$i++]=" . $query_str; } if ($method == '_getAction') { $method = "Events." . substr($method, 1); $params = array("idSite=1","period=year","date=today","format=json"); $query_str = set_url_request($method, $params); $url .= "&urls[$i++]=" . $query_str; } } The above is suppose to yield code formatted in a manner similar to the following HTTP request. Obviously, I have modified it in important ways, Important, however, is that the &urls[0] request appears to be ignored. https://demo.piwik.org/index.php ?module=API &method=API.getBulkRequest &format=json &urls[0]= method%3dVisitsSummary.get %26idSite%3d3 %26date%3d2012-03-06 %26period%3dday &urls[1]= method%3dVisitorInterest.getNumberOfVisitsPerVisitDuration %26idSite%3d3 %26date%3d2012-03-06 %26period%3dday Roddy
×