Tracking page load time to a page when coming from a specific other page/route in datadog - analytics

As the title suggests, I'm trying to benchmark improvement in page load time for a page (for example, /destination), but I'm trying to have the benchmark/graph only count instances where the user is coming from a specific start page (for example, /start).
The reason for this is the changes being made are only applicable when the user is coming from /start, and we don't expect any impact when the user reaches /destination from any other page.
I know that I can use datadog to make a query value (RUM) using:
Measure: Loading Time (#view.loading_time)
Query: ApplicationId: My App, View Path: /destination
but I'm having trouble having the query only look at examples where the user is loading View Path /destination only when coming from /start. Any ideas?
Thanks so much for any advice.

Related

Suggested ways to take a screenshot of a react page

I have a react app that serves a live dashboard to clients (SPA).
Within that dashboard, I have what you might call a 'summary' page that gives the user a periodic summary (in a timeframe of their choosing).
Some of those users, want to receive a periodic report (a screesnhot of that summary) as PDF to their emails.
My struggle is with the report generation part - one thing that I'm trying is do is have an automated process login to my webpage and take a screenshot.
However, it feels not best-practice, and causes issues (the page has an MFA that I somehow need to bypass, etc.) .
Bottom line, I was wondering if there is a known process to do what I'm looking for.
Thanks.

how to dynamically set title and description of angular single page application for google bot?

i want google bot to recognize titles and descriptions of my pages, the title and descriptions are coming from the database..
i used
document.title = $scope.dataFetchedFromDB.title;
and
document.querySelector("meta[name='description']").content = $scope.dataFetchedFromDB.description;
and it does change the title and description in the browser, but not in the snippets fetched by google or facebook or slack.... the old title and description remains.
i know about ng-meta npm package, but i dont have my pages on static route, the route is determined by the page ID (every page has its ID and its description and title)
i also read
Remember that while Google says that they use JavaScript to crawl pages, Facebook, Twitter, etc., do not. You can test Google's render of your page from the links here.
But Google takes a while to index these changes in their snippets. I would recommend creating a Google Search Console account and having it fetch-and-render the pages you want it to re-index. Even then, public results make take days or weeks to reflect your changes.
Also, it seems that the Googlebot with Javascript doesn't have a lot of patience. Try to make sure you are changing your Title and Description within mere moments of the page loading, and not at the end. In little tests, it appears that the Googlebot renderer may time-out after a few seconds, and only capture the original Title and Description.
In order to get other sites like Facebook/Twitter to render the proper metadata, you'll need to server-side render these pieces of data. Whatever appears when you say "View Source..." will be seen by these simplified crawlers. Consider updating to Angular (from AngularJS) and try server-side rendering for your metadata.

Showing custom view based on user role in angularjs

I want to show different views based on the user of my application for example if the user is admin he can see all the controls or when it is acting as user he can only see a subset of controls and UI and he can perform the limited action.
One solution that comes to my mind is sending the role information with the page as a JSON but that would require me to have knowledge of the logged in user so, basically I can first check if the user is logged in or not through the cookie? if no I can just load the lightweight version of the login page and after user logs in then I can send a new page altogether with user's profile information embedded in it.
The other approach that I see is that I can bootstrap my angular application and then check the login status and if the login is done, then bring the profile information through a JSON and update the view, but I think it would be slow and error-prone.
I don't know what is best / recommended approach.
First approach seems to be a better approach out of these 2.
Problem with the second approach is you are sending 2 requests to the server - one for login and then 2nd one to get the user role/profile. If you are choosing this approach then you may have few issues depending how are you going to implement it:
If you are updating your UI after login then you will have to decide what should be shown to the user since you don't know the user profile yet. Even if you come up with some minimal privilege UI, there will be another request to get the profile which will kind of refresh the UI again - 2 UI refreshes could be annoying for the user. Not to mention that there 2 requests going which could make your site slow.
If you decide not to update the UI after login but only after you get user profile, still the delay would be more as you will have to wait for response of 2 separate requests. Could be a major issue with slow networks(consider mobile)
If you are using the first approach, you'll get away with above mentioned problems.

Getting pages indexed in Kik browser

I'm having trouble getting pages to show up in the NEW tab and in the Optimized for Kik search results.
All my pages have the required title, meta description, canonical and script tag served if the user-agent contains the string "kik".
Here is an example of a page that isn't being indexed.
http://playcanv.as/p/MW862amA
The pages have been correctly set up for around a week and still aren't showing up. Any ideas why?
Currently, the Kik browser shows a loading screen on top of your website until the window.onload event has fired. If the website takes too long to load the user is presented with an error screen.
Testing locally, http://playcanv.as/p/MW862amA downloaded roughly 5MB before window.onload and took roughly 30 seconds to get there. I'm betting the search index isn't let it in because of this.
So the fix is simply deferring expensive network requests until after window.onload. The easiest solution is to wrap your network calls in kik.ready(function(){})

preventing IE Silverlight caching values in a grid

I have a silverlight application that displays some values in a grid. Another part of the application updates those values and saves the updates to the source data. All of this works fine including the updating of the displayed values in the grid...until you navigate back to the page later (by say hitting refresh). Then magically all the values in the grid are back to whatever they were the first time you went to the page. I can check and verify that the data is in the source system correctly, I can also make it work fine by going into internet options and setting the browsing history to look for a new version of the page every time you visit the page. But I can't guarantee that users will do this.
I have run into this MANY times before with IE but the normal fixes don't seem to work here. I have added a timestamp to the request for the XAP file to ensure that the file is being pulled every time but somehow that is not good enough. I've also added the pragma no-cache tag to the page and still no go. It seems like Silverlight itself is it's own special case. IS there something else that can be done in the SL object to make it refresh every visit??
What code are you using to populate the grid?
If you load the data when the page is created then it will only be pulled from the database once.
If you load the data when the page is loaded or navigated to then it will be pulled from the database every time the page is displayed.
As Ken Smith says in his comment:
move your data retrieval and population code to your main form's OnNavigate event, and out of Application_Startup
This means that if you update the data and then refresh the page it should show the new values.
(I can't be 100% certain without the code)

Resources