real time demographic data for website personalization - analytics

How to get basic demograpic Data for personalizing a webpage.
There is quantcast but it doesn't provide this functionality.
To personalize a webpage it is necessary to get this information in real time, to adapt the webpage before sending it to the visitor.
It's called website personalization and there are alot blog entries about how to gather this data, but there is not one how to use existing data.
Is there a solution ready to use?

Related

Web Apps - How to Dynamically Present Announcements

I am developing a web app that has a page that displays updates and announcements. I am not familiar with how other websites accomplish this. Do people store their announcements/updates in a database and just update their database whenever they have a new announcement?
What are the standard methods that people use to accomplish something like this at scale?
Basically what you want is a backend that runs a websocket port for clients to bind to. So a client would send his request to post an announcement, this could be via the web socket or any other API( REST, SOAP, GraphQL).
The server can then save the announcements in its Database or/and push update to all the clients attached that an announcement was added through the websocket port. Then the client can handle the response from the server according to its logic.
To fetch announcements for clients which were not connected at the time of announcement via websocket, you can just reply with all the announcements made after a client disconnected.
There are a lot of possible solution, all with different degree of difficulty and flexibility:
1. Hardcode everything in your HTML page
It's the easier solution in the short term, but it would become harder and harder as the projects grows. I would not suggest doing this even for smaller projects.
2. Save the list on a committed data source
For example, create a JSON file in your project with the following structure:
[
{
"type": "announcement",
"date": "2020-08-18",
"title": "New announcement!",
"content": "Bla bla bla...",
},
{
"type": "update",
"date": "2020-08-18",
"title": "Version 2.1.0",
"content": "Here is the changelog: ...",
},
]
Then your webapp can load this file and render it accordingly. This approach has some advantages:
You don't need to rewrite all the boilerplate html everytime
The changes on the update page are committed, so they are easier to review or cancel
However, you still need to insert html in your content field and that could be problematic to do by hand everytime (especially if you need to add images, tables or more complex elements). Also, the changes are in the codebase, so they can not be delegated to a not-technical person (such as the marketing manager).
Also, it is not very efficient to load and parse a json file everytime. You can add some caching, but it's still not as performant as a database
3. Save the list manually in the database
This solution is very similar to number (2). It provides some performance improvement, but most of the other disadvantages remains valid.
4. Use a database and implement a GUI for creating/editing/publishing announcements
The ideal solution is to use a database, while also implementing in the backend a restricted area where it is possible to manage the announcements using a WYSIWYG editor.
Advantages:
Maximum flexibility and it does not require writing the HTML by hand everytime
Anyone can write and publish the announcement, it does not have to be a developer
Disadvantages:
You need to develop the whole editing/publishing system
I don't know whats your programming language or technologies you're using. But, I guess you want a realtime updates and announcement. I'm suggesting you to use realtime databases like FCM to handle it:
https://firebase.google.com/docs/cloud-messaging/concept-options?hl=id
In this example, it using NodeJS:
https://thecodebarbarian.com/sending-web-push-notifications-from-node-js.html
It depends upon how you want to handle it.
Some use this technique of storing in a database and updating it.
Another approach is that you can simply use a web crawler to import the announcement/notices if you are taking references from another websites and you won't need to create a database too. But, your website will be little bit slow but will save the memory for database.
The standard method for putting text onto webpages without hardcoding it is using a content management system or CMS. This can be big and complex, or simple and lightweight.
The approach I've seen work best is to use a "headless CMS", which gives non-technical people a UI to enter the content, and an API which allows your application to grab that content (e.g. as JSON), and render it in whichever framework you're using. This works for "Announcements", or other text content like FAQs, terms & conditions etc.
Another approach is to use a "static site generator" which takes text in a specific format and spits it out as HTML. You could use this to build a pipeline to take "announcements" written in markdown and committed to Git, which are converted by the static site generator into an HTML snippet, which you then render using your NodeJS application.
As stated before, a CMS (content management system) is probably the way to go. If you haven't decided on how to build your web app, I would strongly advise you to use a web framework.
If you are in search of a good solution I would recommend Django and Django CMS.
Both are well documented, open-source and can scale as needed.
Django:
https://docs.djangoproject.com/en/3.1/contents/
Django CMS:
http://docs.django-cms.org/en/latest/

How to properly construct and use API to feed different sections on a web page for data they require?

I am working on an article listing website. The site home page has 3 sections. On top it displays a slider/carousel with 3 slides followed by an article list with 6 items and a "Load more" button (to load next set of articles). After the list, there are 2 sections displaying spotlight or featured articles. The front-end uses react and each of this section is a component.
For back-end it uses REST API (Node + Mongodb). I can fetch all articles calling an API endpoint but i want to know how those 3 sections on the home page should consume it? Should i create and use separate API calls for each of the section? What would be the best way? Please help.
In general i feel splitting each component responsibilities and have them handle their own calls is the best way to go, the code is clearer, easier to maintain and more scaleable.
However one thing to keep in mind is the expected network latency for your users.
In a high-latency situation with otherwise good bandwidth, many small requests will perform significantly worse than one large one.
You should also question when (if) you send one large response is all/most data available from it used? Or is most of it wasted on a state most users wont even reach?

Should I filter data in backend or frontend?

I have a web service built with Spring, my view is built with React and I use Redux for state management.
Let's say my API has an endpoint /api/products and I've implemenented search functionality, which pulls all the products from the enpoint, stores them in Redux store and displays them. Now I want to implement sorting functionality and I have two ideas for achieving it:
Modify my api endpoint /api/products to take parameters. For example /api/products?sortBy=price (less logic in UI, more network requests)
Use the products that I have stored in the store. (less network requests, more logic in UI)
Which one of these, if any, would be considered as the best practice?
It would depend on
What is the acceptable latency? How often do you need to call this list? Almost every second, like in an autocomplete field? Say, a few times a minute, for a report which is sorted by different parameters by the user? Or something like a rarely used settings page?
How much data do you have? Is it a few million? or a few dozen? If it is too many, better to filter in the backend and send only the required rows.
How big is each row? If each row is big with many fields, your payload will increase.
Are you having to make a tradeoff between initial load time (to load all the data from the backend once) vs responsiveness (when the user is interacting with the data)?
I hope this will give you the general idea on how to decide. Maybe able to discuss more if you have details of your specific situation.
You have to use backend. If you have like 3000 records, you need to use pagination. You shouldn't sort all pages on frontend, because it would be too much data. You need to use backend to sort and send only data you want to display on specific page.
Please dont use backend functionality in your Frontend.
Spring Boot is an great framework and offers you Sort and Pageing functionalities.
Example:
public interface UserRepository extends CrudRepository<User, Long> {
Page<User> findAll(Pageable pageable);
List<User> findByLastname(String lastname, Sort sort);
}
Please look into the Documentation -> Spring Data Jpa

How to interact Users(input form data) Using Salesforce Sites into the SalesForce Application(to Custom objects)

First of all I'm really sorry if i'm asking a Dumb Question. But unfortunately i can't find out a way to take inputs for my salesforce Application.
I am developing a simple CV Management app, but i can't figure out how to interact users(input data) to the App? I have created Candidate Custom object, and manually i can create the Candidates, but my requirement is to create records by Candidates themselves.
I followed SalesForce Tutorials and i found out a way to display data using VisualForce Custom Pages. But what i want to## Heading ## do is when i giving a link to the user, he can go to that link and there having form to fill with his personal data, and submit only. But i'm just confused how to user input data map with our Custom Candidate object fields.
when i'm searching i saw some FormAssembly and Custom VisualForce Pages. But Problem is I don't hope to use any 3rd party apps.
Tutorials says that;
In the past, to make Force.com data available to the general public, you had to set up a Web
server, create custom Web pages (JSP, PHP, or other), and use the API to integrate Force.com
apps with an external website. This is no longer the case, thanks to Sites!
Please if you can, help me Friends, Really Appreciate it & Thank you soo much..
You'll probably want to do something along these lines...
Create a Visualforce page with standard controller set to your custom object which is the "CV Entry" page (to send candidates to)
Create a Force.com site in your salesforce org to allow public or restricted access to the page
Setup page authentication/permissions as required

Building my own `like` system

I am thinking to build my own like system, as a way of learning various technologies including Javascript; and to gain a better understanding of authentication and XSS.
Use-case:
Unique ID generated atop a little bit of Javascript code, for embedding in any website
When unique user presses this like button, a +1 is triggered to the 'score' of that UID
On unique user's profile, display what they like'd
I'm unsure as where to start... how would I go about building this system?
Building such system is easy. Securing it properly, making it flow nice and be easy to integrate is the hardest part. You should ignore the latter 3 for now. I would start with a JS file that searches the DOM for any elements with the ID of "mylike" (for example) which inserts a button on to said page. Once a user clicks the button it simply does an AJAX post back to your server containing information like the page title and page URL. I think it may be best for your backend to generate the ID, maybe an algorithm based on the title + URL.
To include user data to know what user liked what I'd suggest a persistent cookie that has a session variable to link to a user in your back end. Simply pull the cookie out using JavaScript and send the cookie along with the AJAX request.

Resources