<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pandurang Patil on Medium]]></title>
        <description><![CDATA[Stories by Pandurang Patil on Medium]]></description>
        <link>https://medium.com/@pandurangpatil?source=rss-2dbd375739e3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6XcPS8-KFtB425-CUszBJg.png</url>
            <title>Stories by Pandurang Patil on Medium</title>
            <link>https://medium.com/@pandurangpatil?source=rss-2dbd375739e3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:43:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pandurangpatil/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[First-party and third-party cookies]]></title>
            <link>https://pandurangpatil.medium.com/first-party-and-third-party-cookies-ae3a6748fdc8?source=rss-2dbd375739e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae3a6748fdc8</guid>
            <category><![CDATA[digital-marketing]]></category>
            <category><![CDATA[ppc]]></category>
            <category><![CDATA[digital-advertising]]></category>
            <category><![CDATA[ppc-marketing]]></category>
            <category><![CDATA[third-party-cookie]]></category>
            <dc:creator><![CDATA[Pandurang Patil]]></dc:creator>
            <pubDate>Wed, 11 May 2022 10:34:57 GMT</pubDate>
            <atom:updated>2022-05-11T10:34:57.150Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*zSV42a8a6GzAVTE0ZMnXFQ.jpeg" /></figure><p>Recommended to first go through my earlier articles</p><p>How the browser renders the website page? — <a href="https://pandurangpatil.medium.com/how-browser-renders-the-website-efe65ba9dc26">https://pandurangpatil.medium.com/how-browser-renders-the-website-efe65ba9dc26</a></p><p>How does the HTTP protocol work? — <a href="https://pandurangpatil.medium.com/how-does-http-protocol-work-426b1a4158f3">https://pandurangpatil.medium.com/how-does-http-protocol-work-426b1a4158f3</a></p><p>How are cookies handled by the Browser? — <a href="https://pandurangpatil.medium.com/how-cookies-are-handled-by-the-browser-8e8f650c8a99">https://pandurangpatil.medium.com/how-cookies-are-handled-by-the-browser-8e8f650c8a99</a></p><p>If you have gone through the above articles probably you have been able to connect the dots between HTTP cookies, requests, server &amp; Browser.</p><h3><strong>Now let’s understand how to differentiate between first-party and third-party cookies.</strong></h3><p>When you try to access any website from your browser e.g. “https://www.facebook.com”. It will open the respective site’s default page in your browser. While accessing this page the cookies that are created against the domain of the site in this case “www.facebook.com” or its parent domain i.e. “.facebook.com” are called first-party cookies.</p><p>1. Let’s take an example open incognito mode and hit “https://www.facebook.com” in the address bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JST7V_yO1nn5x6DOEUDSyA.png" /></figure><p>Open dev tools and go to the “Application” tab. From the left panel expand the “Cookies” section. You will find there are a few cookies created against the “.facebook.com” parent domain of “www.facebook.com”. These are first-party cookies in the context of the current site being accessed. Any other cookie whose domain doesn’t end with “facebook.com” while accessing <a href="https://www.facebook.com/">https://www.facebook.com</a> will be a third-party cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*qDl0bjsoHlOkNWGsrZjEUg.jpeg" /></figure><p>2. Let’s take another example to understand both first-party and third-party cookies in one place. Open another tab in the same incognito window and hit “https://www.ugaoo.com”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DsZbXjW4PRcOn9wXdy5JXQ.png" /></figure><p>When you access this site and look at the cookies you will find cookies being created against “www.ugaoo.com” as well as “.ugaoo.com”. These cookies are will be referred to as first-party cookies as these are created against the URL domain that you are accessing i.e. <a href="http://www.ugaoo.com/">www.ugaoo.com</a></p><p>You will also find cookies against the domain “.facebook.com”, “.doubleclick.net”, “.google.com” etc. These are the third-party cookies referred to and used while accessing this “www.ugaoo.com” site.</p><p>If you pay attention to the cookies with the domain “.facebook.com” you will find the value of these cookies is the same as that of cookies we witnessed while accessing the “www.facebook.com”.</p><p>So first-party and third-party cookies are relative to the site being accessed by the user. If the site being accessed by the user is “www.facebook.com” then all the cookies that are created with the domain “www.facebook.com” or “.facebook.com” are first-party cookies. Same cookies will be treated as third-party cookies when the user access “www.ugaoo.com”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*zSV42a8a6GzAVTE0ZMnXFQ.jpeg" /></figure><h3><strong>This raises the next question of why “.facebook.com” cookies are being used while accessing “www.ugaoo.com”.</strong></h3><p>This is because when we drop a Javascript Facebook meta pixel on any site, in this example there is a Facebook meta pixel dropped on “ugaoo.com”. This pixel will make HTTP requests to “facebook.com” servers to record the events fired on the user’s browser. Because these HTTP requests are made to “facebook.com” servers while the user is accessing the “ugaoo.com” site these cookies which are mapped to the “.facebook.com” domain is getting accessed.</p><p>The same is the case for “.google.com” cookies as Google Analytics and Google ads pixel were dropped on “ugaoo.com”, hence being accessed.</p><p>However, you might wonder how come “.doubleclick.net” is accessed. As you might not have dropped any pixel directly on your site from “doubleclick.net”. This is where the magic of HTTP or web works unknowingly and not so techy people fail to connect the dots.</p><p>It is possible to add another pixel from one pixel through Javascript, which is what Google Tag Manager facilitates. In the case of “doubleclick.net”, it has been added through Google Ads pixel which is used for identifying users for Google’s display network. Which is operated under the “doubleclick.net” domain even after Google acquired DoubleClick 15 years back.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae3a6748fdc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How cookies are handled by the Browser?]]></title>
            <link>https://pandurangpatil.medium.com/how-cookies-are-handled-by-the-browser-8e8f650c8a99?source=rss-2dbd375739e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e8f650c8a99</guid>
            <category><![CDATA[ppc-marketing]]></category>
            <category><![CDATA[digital-marketing]]></category>
            <category><![CDATA[third-party-cookie]]></category>
            <category><![CDATA[digital-advertising]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Pandurang Patil]]></dc:creator>
            <pubDate>Tue, 26 Apr 2022 11:40:23 GMT</pubDate>
            <atom:updated>2022-04-26T11:40:23.698Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*z6V8OMLRQyejV7h6PnOKsw.png" /></figure><p>Recommended to first go through my earlier articles</p><p>How the browser renders the website page? — <a href="https://pandurangpatil.medium.com/how-browser-renders-the-website-efe65ba9dc26">https://pandurangpatil.medium.com/how-browser-renders-the-website-efe65ba9dc26</a></p><p>How does the HTTP protocol work? — <a href="https://pandurangpatil.medium.com/how-does-http-protocol-work-426b1a4158f3">https://pandurangpatil.medium.com/how-does-http-protocol-work-426b1a4158f3</a></p><h3><strong>What’s the purpose of the HTTP Cookie?</strong></h3><p>As I explained in my earlier articles above, HTTP is a stateless protocol. In order to facilitate this state between Browser and Server HTTP Cookie got introduced. HTTP Cookie facilitates an inherent mechanism to exchange this state between server and Browser. It’s a layer on top of the HTTP protocol with the use of the “set-cookie” response header and “cookie” request header (to understand the request and response header <a href="https://pandurangpatil.medium.com/how-does-http-protocol-work-426b1a4158f3">refer</a>).</p><p>One of the common use cases of Cookie is to identify the same user between multiple HTTP requests originating from the same Browser. For which There has to be an exchange of unique identifier token between server and Browser. Whenever the server wants to identify the same user, the server will try to read the incoming Cookie token from the “cookie” request header. If it doesn’t find it, the server will create a new unique token, saves it on the server-side as well as send it to the Browser using the “set-cookie” response header. The browser will save this Cookie on the user’s browser storage mapped to the server domain or its parent domain of the server domain (e.g. <a href="http://www.facebook.com)./">www.facebook.com).</a> And it will send this cookie back to the Server every time (no matter whether an HTTP request is being made from the current page opened from the same domain or any other domain) whenever the browser makes a request to the <strong>same domain</strong> ( e.g. <a href="http://www.facebook.com/">www.facebook.com</a>). With third-party cookies being blocked this behavior is going to get changed and Browser will only allow Cookies to be saved and sent only against the HTTP requests made to the original server domain of the page. (more on this in the next article)</p><h3><strong>Let’s understand the structure of the Domain, parent domain, &amp; subdomains.</strong></h3><p>Understanding domain name structure properly is required to understand how cookies are mapped to the domain. In turn how cookies are accessed with respect to the given domain.</p><p>When we buy any domain like agnie.net or ugaoo.com it is called a root domain (more examples are google.com, faceboo.com, carscan.ai, etc). However, the root domain is rarely used to point directly to the site (there will be some exceptions, in recent days I came across some eCommerce sites directly pointing root domains to their site). The popular subdomain i.e. www is being used by the majority of the sites to point to their main site. The owner of the root domain can create any subdomain using DNS zone files given by their domain service provider.</p><p>So root domain owners can create subdomains e.g. <a href="http://www.ugaoo.com,/">www.ugaoo.com,</a> dev.ugaoo.com, etc. In this example, “ugaoo.com” will be the parent domain of “www.ugaoo.com” and “dev.ugaoo.com” in reverse “www.ugaoo.com” &amp; “dev.ugaoo.com” are subdomains of “ugaoo.com”.</p><h3><strong>How HTTP cookies are handled from the Server?</strong></h3><p>There are two ways HTTP cookies can be created on the browser from the Server-side and through Javascript running on Browser itself. In this section, we will first focus only on the Server-side mechanism.</p><h4><strong>How Cookies are created from the Server?</strong></h4><p>Cookies can be created as well as accessed from the server when any kind of HTTP request is made to the server. When I say any kind of request I literally mean any kind of HTTP request. That includes the URL you hit in your address bar of the browser to resource URL requests made by the browser to fetch the image, javascript, font, &amp; CSS while processing the HTML page.</p><p>With this mechanism, the Server can ask Browser to create a cookie by sending a “set-cookie” response header. While we can create the cookies from the server-side, it allows the server to create cookies against the same domain to which the browser had made a request including its parent domain (assuming the request is made to the “www.facebook.com” server, it can set the cookie against “www.facebook.com”, “facebook.com” or “.facebook.com”. However, it cannot set the cookie against “staging.facebook.com” or any other subdomains of “facebook.com”). If the server tries to set the cookie against a domain other than the requested domain from the Browser. The browser simply rejects and doesn’t create the cookie for that domain. We will discuss the structure of the cookie in the below section. (if the requested URL is <a href="https://www.facebook.com/tracker">https://www.facebook.com/tracker</a> then, in this case, the requested domain will be “www.facebook.com”. It can set cookies mapped to “www.facebook.com”, “facebook.com” or “.facebook.com” but cannot set cookies against “<a href="http://www.google.com/">www.google.com</a>” or for that matter against the current page URL domain.)</p><h4><strong>Let’s understand the structure of the HTTP Cookie</strong></h4><p>The basic structure of the HTTP cookie has only two parts cookie name and its value a pair of key value. There are other attributes attached to this key-value pair that facilitate how this cookie will be accessible either on a browser (through Javascript) or while sending it to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mEr4jnMxONU-1YSQyNqWw.png" /></figure><p>Following attributes are used while creating the cookie</p><p><strong>Name</strong> — name of the cookie that could be any string without special characters. (Basic and required attribute)</p><p><strong>Value</strong> — Value of the cookie (basic and required attribute)</p><p><strong>Domain</strong> — Domain of the cookie. If this attribute is not configured while creating the cookie. It is inferred based on the situation. If cookie is being created through “set-cookie” response header from Server without domain. The cookie will be created and mapped against the requested URL domain. If cookies cannot be set against any other domain apart from the requested domain. Then what’s the purpose of this option given at the time of the creation of the cookie? It has been given to possibly create the cookie against the parent domain or make it available across the subdomain of the parent domain. (<strong>when you create the cookie with the parent domain prefixed with “.” e.g. “.facebook.com”, that cookie will be accessible across all the subdomains of “facebook.com”</strong>)</p><p><strong>Path</strong> — This attribute asks the browser to provide access to this cookie only for this path of the URL and its subsequent child paths.</p><p>E.g. “/user” if this path is being set while creating the cookie. This cookie will be accessible to the server when the request URL path starts with “/user” e.g. “https://www.facebook.com/user” it is also accessible to the child paths e.g. “https://www.facebook.com/user/a234-sdfb/”. If you want the given cookie to be accessible for any URL path then you need to set this path to “/”.</p><p>If you don’t set this path attribute while creating the cookie, the browser will assume the URL path of the request. E.g. if the cookie is getting created while making this request “https://www.facebook.com/session” then the path of this cookie will be set to “/session”.</p><p><strong>Expires </strong>— This attribute singles browser to set the lifetime of this cookie. With this attribute, you are supposed to set DateTime for the expiry of the cookie. The browser will store this cookie till the expiry DateTime is configured for this cookie.</p><p>If you don’t set this attribute, it will be treated as a session cookie. That means the browser will delete this cookie once the user exit the Browser (Closing the tab or one window will not end the session. It will end only when all the windows of the browser are closed.)</p><p><strong>HttpOnly</strong> — This attribute indicates to the browser to send this cookie along with HTTP requests made to the server. But if you try to access this cookie on Browser through Javascript, it will not be accessible. If you don’t set this attribute then it will be sent along with an HTTP request to the server as well as it will be accessible on the browser through Javascript.</p><p><strong>Secure</strong> — This attribute indicates to the browser to send this cookie to the server only when HTTPS requests are made to the server.</p><p><strong>SameSite</strong> — This attribute specifies whether to send this cookie along with HTTP requests apart from the current page URL domain. That means if a user is browsing <a href="http://www.ugaoo.com/">www.ugaoo.com</a> and the browser already has a cookie created against <a href="http://www.facebook.com/">www.facebook.com</a> but that is set with “SameSite” attribute with either “Strict” or “Lax” then don’t send this cookie while making any HTTP requests made to “<a href="http://www.facebook.com/">www.facebook.com</a>” to fetch any resources.</p><p><strong>SameParty</strong> — This attribute has been introduced in the wake of third-party cookies getting disabled. This is to facilitate certain functionalities (like single sign-on) which rely on sharing cookies across domains of an organization. It is still evolving functionality, refer to this <a href="https://pandurangpatil.medium.com/how-does-http-protocol-work-426b1a4158f3">article</a> for more details.</p><p>For more detailed information about the different attributes of the cookie <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies">refer</a></p><h4><strong>Accessibility of the cookie from the server</strong></h4><p>In the above section, we discussed how cookies are created from Server and while creating the cookies what all attributes can be attached, which will define the accessibility of the given cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O6jom2xUnFwdPuz1PdF1sw.png" /></figure><p>Let’s understand how and when these cookies are being sent to the server and in which format. Whenever a browser makes an HTTP request to the server, it will find all the cookies mapped to the given request URL based on domain, expiry, path, secure, HttpOnly, SameSite &amp; SameParty attributes of the cookie. Creates a “;” separated string of key=value tokens from those list of cookies and sends this string through the HTTP request header “cookie” (refer to my earlier <a href="https://pandurangpatil.medium.com/how-does-http-protocol-work-426b1a4158f3">article</a> to understand the request header). Refer above screenshot of the actual request from the dev tools panel of Chrome. Server-side technologies facilitate access to these cookies to read them from the request header.</p><h3><strong>Can we create the cookie through Javascript on the Browser side or access it?</strong></h3><p>Yes. We can create the cookie through Javascript on the browser-side as well as access the cookies through Javascript.</p><p>However, this cookie can be created only against the current page domain and its parent domain. No matter whether the Javascript code is served from the same domain as that of the page or any other domain. You cannot create an HttpOnly cookie from Javascript.</p><p>Similarly one can read the cookies mapped to the current page domain through Javascript along with other restrictions that we discussed above against each attribute of the cookie.</p><p>Third-party cookies are created only using the serer-side mechanism. Which is what gets disabled from the browser side. (more on this in the next article)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e8f650c8a99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How does HTTP protocol work ?]]></title>
            <link>https://pandurangpatil.medium.com/how-does-http-protocol-work-426b1a4158f3?source=rss-2dbd375739e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/426b1a4158f3</guid>
            <category><![CDATA[ppc]]></category>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[ppc-marketing]]></category>
            <category><![CDATA[third-party-cookie]]></category>
            <category><![CDATA[digital-marketing]]></category>
            <dc:creator><![CDATA[Pandurang Patil]]></dc:creator>
            <pubDate>Tue, 05 Apr 2022 12:07:27 GMT</pubDate>
            <atom:updated>2022-04-05T12:07:27.040Z</atom:updated>
            <content:encoded><![CDATA[<h3>How does HTTP protocol work ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*HdQUmPaxyXug2eU1y5iPzQ.png" /></figure><p>Recommended to first go through the earlier <a href="https://pandurangpatil.medium.com/how-browser-renders-the-website-efe65ba9dc26">article</a></p><p>Anywhere I have mentioned “client” read it as “Browser”.</p><h3><strong>HTTP is a stateless protocol. What does that mean?</strong></h3><p>HTTP being a stateless protocol plays a very important role in the introduction of cookies.</p><p>When a Browser has to make an HTTP request to the server. A Request connection is opened with the Server. The server accepts the connection request and then the client (Browser) sends HTTP request metadata (Read further to understand more about this metadata) to the server. The server processes this metadata and responds to the given request accordingly. Once the server responds to the client’s request, the connection opened by the client gets closed from the server end. To fetch further resources from the server, the client has to create a new connection to the server for every individual resource (CSS, JavaScript, Image, Font &amp; video).</p><p>By default HTTP protocol doesn’t have any implicit provision for the server to identify a unique browser client (user). That’s because HTTP protocol doesn’t provide any inherent mechanism to maintain the state between multiple requests originating from the same client. Hence it’s been called a stateless protocol.</p><p>HTTP cookies have been widely used to establish this state between client and server, since the early days. With the introduction of browser-side storage in recent years, that’s another mechanism that facilitates the state between client and server. (How Cookies are being used to establish the state between server and client will be covered in the next article.)</p><h3><strong>Let’s look at what this request metadata looks like and what all data is sent from browser to server as part of request metadata.</strong></h3><p>Follow below steps</p><ol><li>Open a new tab in incognito mode (if you already have an incognito tab open close all such tabs and create a new tab).</li><li>open dev tools (refer to the below screenshot)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IxuhqvGdNU0PQh5M" /></figure><p>3. Make sure to open dev tools and then hit the following URL <a href="https://www.ugaoo.com/live-plants.html">https://www.ugaoo.com/live-plants.html</a>. Inside the “Network” tab of the devtools panel, you will find similar request data as displayed in the below screenshot.</p><figure><img alt="HTTP Request response sample" src="https://cdn-images-1.medium.com/max/1024/0*7qfXpDyDBCUff-z4" /></figure><h3><strong>Let’s now dissect the request that we made.</strong></h3><p>We made a request to <a href="https://www.ugaoo.com/live-plants.html">https://www.ugaoo.com/live-plants.html</a> from the browser address bar. This is the very first request you will find inside the “Network” section initiated by the browser. Subsequent below requests made by the browser are a result of other resources that the browser starts fetching when it starts processing the HTML response of the first request (as explained in the first <a href="https://pandurangpatil.medium.com/how-browser-renders-the-website-efe65ba9dc26">article</a>).</p><p>Inside the “Network” section of dev tools, you will find the following details.</p><h4>HTTP Request</h4><p>URL — <a href="https://www.ugaoo.com/live-plants.html">https://www.ugaoo.com/live-plants.html</a></p><p>Request Metadata ( You will find below metadata about the request under the “Request Headers” section. Refer above “Network” section screenshot).</p><p><strong>Method</strong> — GET (Indicates this is a fetch data request from the server). There are different methods defined as part of the HTTP protocol<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods"> refer</a> for more details. By default, every request we make by hitting the URL in the browser is made with the “GET” method.</p><p><strong>URL Path &amp; Query parameter</strong> — /live-plants.html — This is the path requested by us. Query parameters are additional inputs we can pass to the server appended to this path.</p><p><strong>Headers </strong>— Under “Request Headers” all the key values except those start with “:” are considered to be part of the HTTP request headers.</p><p>some of the headers e.g.</p><p><em>accept</em>: Indication of response formats supported by the client (Browser).</p><p><em>user-agent</em>: This is a header sent by the client which indicates the type of the client (Browser). <em>This is the header that gets used for device targeting for any ad campaign.</em></p><p>You can ignore other request headers for now.</p><p><strong>Body </strong>— As the current request is to fetch the data (GET) there is no data being sent through the body of the request. However when the browser makes a request to save data on the server (method: POST or PUT) that data will be sent to the server through the body.</p><h4><strong>HTTP Response </strong>(Refer above “Network” section screenshot)</h4><p><strong>Response status code </strong>— Response status code indicates how the server is responding to the request. In this case, it is 200. It indicates a valid request with a successful response. There are other various status codes suggested by HTTP protocol (<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status">refer</a>) to indicate different response situations.</p><p>e.g.</p><p>200 series — Successful response</p><p>300 series — Redirection suggestion by the server. These response codes are used by the server to signal the client to follow the new URL suggested by the server.</p><p>400 series — Indicates some error on the client-side either invalid URL, invalid request, or not authorized.</p><p>500 series — Indicates some error on the server-side. There are different 500 series to indicate different kinds of server errors.</p><p><strong>Headers </strong>— Similar to request headers (used by the server to process the request) these are the response headers that are used by the client to process the response.</p><p>Some of the common response headers are</p><p><em>content-type</em>: This response header indicates the format of the response body itself. In the context of the current request, it is “text/html”. Which indicates the response is in HTML format.</p><p><em>set-cookie</em>: Here we go, this is the response header sent by the server to set a cookie inside the browser. In this case, it’s a PHP server, and this cookie (PHPSESSID=&lt;unique identifier&gt;) is created to uniquely identify the user browser. For now, let’s just understand that this cookie is created and saved on the browser side (even if you close the browser, it will remain persistent on the browser side till it doesn’t get expired). It will be sent with each subsequent request made by this browser to the same domain<a href="http://www.ugaoo.com/"> www.ugaoo.com</a> (Server). (we will discuss cookies in detail in the next article).</p><p>If you refresh the page and look at the request headers in the network tab again. This time you will find the “cookie” request header is being sent by the browser to the server. This is the same cookie “PHPSESSID” that was sent as part of the response header in an earlier request. You will find there are more cookies that are being sent this time. These cookies are created by some of the analytics or advertising javascript code on this site. These cookies are created with JavaScript code on the browser side itself. ( we will talk about this in detail in the next article.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o1CeONbadXCEuUWx" /></figure><p><strong>Body </strong>— If you switch the tab to “Response” from “Headers” as shown in the below screenshot. You will find the response body, which is an HTML page returned by the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MGioCN6yx_sZnLfr" /></figure><p>To summarise with HTTP request browser sends the input through different request metadata sections (method, headers, path, query parameters, and body). The server responds with response metadata in the form of status code, headers, &amp; body.</p><p>HTTP protocol specification defines the standard that every browser is expected to follow. As well as developers who are building web applications need to pay attention to these standards and implement the application in compliance with these specifications (Which is not always the case, and results in bugs as well as security loopholes).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=426b1a4158f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How the browser renders the website page]]></title>
            <link>https://pandurangpatil.medium.com/how-browser-renders-the-website-efe65ba9dc26?source=rss-2dbd375739e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/efe65ba9dc26</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[third-party-cookie]]></category>
            <category><![CDATA[digital-advertising]]></category>
            <category><![CDATA[digital-marketing]]></category>
            <category><![CDATA[ppc-marketing]]></category>
            <dc:creator><![CDATA[Pandurang Patil]]></dc:creator>
            <pubDate>Fri, 01 Apr 2022 13:27:03 GMT</pubDate>
            <atom:updated>2022-04-04T08:06:57.516Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*Z9iePMmqeEyrr7lNGds1fg.png" /></figure><p><strong>Let’s briefly understand when you open the browser and type in the web address like </strong><a href="http://www.medium.com./"><strong>http://www.ugaoo.com.</strong></a><strong> What all things happen behind the scene roughly, before you start seeing the website page being rendered in your browser.</strong></p><ol><li>The very first thing browser does is to try and resolve the domain <a href="http://www.medium.com/">www.ugaoo.com</a> to IP address/s.</li><li>The browser then makes an HTTP request to that server behind that IP address with the URL path that you requested in the browser address bar.</li><li>When a browser makes a request, it first opens a connection with the server. Then sends an HTTP request to the server.</li><li>With the assumption that the server is capable to understand HTTP requests. The server will process the incoming request and respond appropriately based on the requested path.</li><li>If the requested path is invalid or requires authentication. The server will respond with a relevant error or redirect you to the login page respectively.</li><li>Assuming your requested path can be served by the server. The server will respond with an HTML page, which gets rendered in your browser.</li><li>Once the entire response is sent from the server, it will close the connection opened by your browser. (NOTE: pay attention to the 3rd and 7th points. The HTTP protocol is said to be stateless. Closing the server connection once the entire response is sent is why it is called stateless.)</li></ol><p>The important point here to understand is that the server can respond with a new URL to which the user can be redirected. You will notice this redirected URL getting changed in the browser address bar.</p><p><strong>Above we looked at how the server receives the request and responds with the HTML page. Let’s now briefly understand what is HTML page is all about.</strong></p><p>What is an HTML page?</p><p><strong>Long-form</strong> — HyperText Markup Language.</p><p>Its text file which contains HTML &lt;html&gt;, &lt;img&gt; &lt;a&gt; etc with their respective starting and ending tags, arranged in defined structure by the HTML standard. These tags are arranged in parent child relationship like below. Entire contents are enclosed inside starting and ending &lt;html&gt; tag.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/280e5ed1784428ed18f516cbd318d8a4/href">https://medium.com/media/280e5ed1784428ed18f516cbd318d8a4/href</a></iframe><p>The HTML page is divided into two major sections &lt;head&gt; and &lt;body&gt;. The first &lt;head&gt; section contains the tags and contents related to showing the title, logo, and other relevant configurations used by the browser to render the page properly. It also ideally contains other resources like CSS &amp; javascript URLs which are processed by the browser to render the page. ( I will not get into details of what is CSS and Javascript. They themselves are big topics individually to understand in detail). The second section &lt;body&gt; contains the HTML tags which result in the page that you see in your browser.</p><p>There are a few other resources that contribute to the page rendering that we see in the browser.</p><p><strong>JavaScript — &lt;script&gt;</strong> — It’s a programming language that facilitates the processing of actions taken by the user like validating the inputs. Along with that it also facilitates the generation of HTML content dynamically on the browser side. Modern age SPA (Single Page App) frameworks use this mechanism. (I will publish a separate article on SPA).</p><p><strong>CSS (Cascading Style Sheets) — &lt;style&gt;</strong> — as its name suggests it provides styling for the HTML elements with color, font, and other design styles.</p><p><strong>Images — &lt;img&gt;</strong> — All the images that we see on the page, are rendered through this image tag.</p><p><strong>Font</strong> — If the HTML page is using any font which is not a standard font available on any machines. It will be downloaded from the server.</p><p><strong>Other media</strong> — Other media resources like video will be configured inside the HTML page with respective HTML tags.</p><p>HTML provides a page layout that binds together all the above-mentioned resources required to render the page.</p><p><strong>Now let’s look at how a browser renders the HTML page once it receives the response from the server.</strong></p><p>The browser starts processing the HTML page line by line from the beginning till the end of the page. It starts rendering the HTML tags placed inside the &lt;body&gt; tag to show the page content. While rendering these HTML tags, when it encounters above mentioned resources. It makes a separate HTTP request to fetch those resources from the server.</p><p>Important point to understand here is that these resources may not be just served from the same server. The HTML page may have resources that are pointing to other servers to download these resources. It is this mechanism that facilitates easy integration with different digital advertising services between publishers and advertisers.</p><p>The browser starts rendering the page the moment it starts receiving the HTML as a response from the server, sequentially, &amp; line by line. It doesn’t wait for the entire HTML to get downloaded on the browser side. If you have witnessed internet browsing from the telephone dial-up era, you might recollect, the page being rendered slowly starting from the top to the end of the page.</p><p><strong>The last important aspect to understand is how navigation between different pages of a site is being facilitated through HTML pages.</strong></p><p>Navigation to another page from the page which has been rendered currently, is being facilitated through &lt;a&gt; anchor HTML tag. Page URL configured against any given anchor tag will take the user to that respective page once the user clicks on that anchor tag link. When you click on the link, you will notice the browser address bar URL gets changed to the one which has been configured against the anchor tag.</p><p>The above-mentioned process repeats to display this new page all over again. Unless it’s a SPA web application.</p><p>The important aspect to understand with respect to anchor tag is that the URL configured need not required it to be from the same site. It could point to any publicly available site URL. You can configure the anchor tag to open this new URL inside an altogether new tab.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efe65ba9dc26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evolution of Digital Ad Serving — Part I]]></title>
            <link>https://pandurangpatil.medium.com/evolution-of-digital-ad-serving-part-i-2fcb85dd9143?source=rss-2dbd375739e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fcb85dd9143</guid>
            <category><![CDATA[programmatic]]></category>
            <category><![CDATA[advertising]]></category>
            <category><![CDATA[ssp]]></category>
            <dc:creator><![CDATA[Pandurang Patil]]></dc:creator>
            <pubDate>Mon, 17 Aug 2015 06:56:25 GMT</pubDate>
            <atom:updated>2024-02-17T15:01:43.267Z</atom:updated>
            <content:encoded><![CDATA[<p>In the early days when there were no AdServers to show dynamic ads, publishers used to embed ads statically along with their content. So to display a new ad in a given slot, the publisher has to change their content every time to embed the new ad. Moreover, every user will see the same ad at a given instant of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*VqUDrmUDMnMms-Qi.png" /></figure><p>Picture — 1</p><p>With the growing trend to utilize digital space for advertising, it becomes more obvious to utilise power of digital world for advertisement, as it gives more control over how ads can be displayed. It is easier to get measurable direct feedback that can be utilized to optimize campaigns, which is very difficult with other mediums of advertisement (Print, TV, and Radio), even today. Therefore one needs to have an intelligent system that could dynamically consider this feedback and decide which ad to serve for a given user at runtime. This is where AdServer comes into the picture. In the early days publishers were using ad servers like DART Enterprise (by DoubleClick now acquired by Google Inc. At present more companies provide publisher AdServers e.g. DFP ( DART for Publishers), AdZerk etc. Now Agnie Media Software also provides a Publisher Ad Server ). AdServer enables publishers to manage advertisers’ campaigns to show ads dynamically on their portals. In this case, publishers have their own channels to get the direct ads.</p><p>To integrate with AdServer in place of direct static ads, the publisher now uses Ad-Tag provided by AdServer. This Ad-Tag fetches ads from AdServer dynamically in real-time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/0*JRzX9Omx1nWn3NQf.png" /></figure><p>Picture — 2.</p><p>With the introduction of AdServer in the market, publishers were dynamically able to show different ads from different campaigns. However, with time they started realizing they didn’t have sufficient direct demand (Advertiser Campaigns) to show ads round the clock and fill all the ad slots. As many publishers started facing this issue, it gave way for the mediator to rise between publishers and advertisers, which we know as Ad Network. To integrate with Ad Network, publisher AdServer provides a mechanism called pass back / Default Ad-Tag. Publishers need to register with Ad Network to get their Ad-Tag for an Ad slot and configure the same Ad-Tag as a pass-back/default tag in the publisher Ad Server. This way in the event a publisher AdServer doesn’t have any ad/campaign to serve through direct channels, it passes this opportunity to Ad Network to serve ads. In this situation even if Ad Network doesn’t have any ad to serve, the publisher can pass on the opportunity to another AdNetwork using a similar mechanism. This way a publisher can create a chain of Ad Networks and monetize unsold/blank ad requests through other networks. However, the price will be much lower than the ads that the publisher gets through direct channels.</p><p>You might have heard of Guaranteed Inventory and Remnant Inventory, let&#39;s understand what is it. The ads that are displayed as a result of direct Advertiser campaigns on the Publisher’s website are called Guaranteed inventory. The ads that are displayed after the Guaranteed inventory has consumed their ad slots through the third-party Ad Networks are called Remnant Inventory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/0*OxTvBsrE8nKSoXLb.png" /></figure><p>Picture — 3.</p><p>With the presence of multiple Ad Networks in this space, publishers have different revenue models with different Ad Networks. Each Ad Network pays different pricing for a given ad request, so if a Publisher wants to generate more revenue they must pass the very first opportunity to an Ad Network which will pay more. However, the challenge publishers started facing was that one Ad Network consistently was not able to provide higher revenue. Dynamics change with time, as well as the demand (Advertiser campaigns) an Ad Network has at a given time. These parameters keep on changing over the period of time, which results in a situation where at one time “Ad Network 1” pays more and the other time “Ad Network 2”, and some other time any other “Ad Network” will pay more. In order to maximize revenue, a publisher had to keep on monitoring the revenue being generated through different Ad Networks and keep on changing the pass back chaining to provide the first opportunity to an “Ad Network” that pays more for a given duration. This way Publishers have to apply a good amount of human resources to do all this manually.</p><p>What if this process of manual work is automated? This new automated system will process the historical and current data of revenue generated through different Ad Networks and dynamically decide which Ad Network will get an opportunity to serve the first ad or subsequent ads. This system is nothing but SSP (Supply Side Platform) like PubMatic, Rubicon Project, and Ad Meld. SSP acts as a Revenue optimizer for Publishers by dynamically predicting which Ad Network will pay more for a given ad request. To integrate with SSP, the publisher registers with the SSP and then they will provide an Ad-Tag for a given Ad Slot. Publishers configure this Ad-Tag as pass back Ad-Tag in their Publisher Ad Server in place of Ad Network ad tag. SSP gets an opportunity in the event Publisher Ad Server doesn’t have any direct ads to serve. SSP will select an Ad Network that will pay more as per their prediction, and hence lift the publisher’s revenue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*OtmLKC9HPEXuUFe0.png" /></figure><p>Picture — 4</p><p>Now the revenue optimization problem of the Publisher becomes the problem statement for the SSP and they started exploring more ways through which the revenue of publishers can be lifted. Meanwhile, RTB (Real Time Bidding) in Digital Advertising was taking traction in Ad Exchanges (Will talk about Ad Exchange in a separate article). SSPs also introduced the RTB feature in their platform which in turn started providing additional revenue lifts to the publishers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*El75j7r24PMOLPap.png" /></figure><p><em>Originally published at </em><a href="http://blog.agnie.net/post/evolution-of-digital-ad-serving-part-i"><em>blog.agnie.net</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fcb85dd9143" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>