New Logical Assignment Operators (2023)

Well, these were introduced in 2021, according to the Udemy course I am doing.

the “=” sign, assigns values to things

When there’s additional stuff, before the “=”, like “&&”; then some kind of logic has to be fulfilled before anything is assigned.

Two vertical lines, or pipes – “||” are the “OR” operators

Logical AND Assignment (&&=)

This logical assignment operator only assigns the value if the left-hand side is truthy.

In JavaScript, two ampersands (&&) in an assignment operator form a Logical AND assignment operator (&&=). This is a newer addition to JavaScript, introduced in ES2021.

Here’s how it works:

Let’s say we have two variables, a and b.

If we write a &&= b;, it is a shorter way of saying:

If a is truthy, let’s assign the value of b to a.

If a is falsy, keep a as it is.”

A “truthy” value is a value that is considered true when evaluated in a Boolean context. All values are truthy unless they are defined as falsy—i.e., except for false, 0, -0, 0n, "", null, undefined, and NaN.

So, &&= is checking if the first value is truthy and if so, it assigns the second value to the first one. If the first value is falsy, it remains unchanged.

Screenshot from Geeksforgeeks

Logical OR Assignment (||=)

This logical assignment operator only assigns the value if the left-hand expression is falsy.

This can be useful in cases where we want to keep the existing value if it does not exist, otherwise we want to assign a default to it. 

The Logical OR Assignment (||=) is a shorthand way of performing a logical OR operation and an assignment in one step. This operator was introduced in JavaScript with the ES2021 specification.

Here’s a simple way to understand it:

Let’s say we have two variables, a and b. If we write a ||= b;, it’s a shorter way of saying: “If a is not truthy (meaning it’s false, null, undefined, 0, NaN, or an empty string ”), then assign the value of b to a. If a is truthy (meaning it has any value other than those falsy values), then keep a as it is.”

So, a ||= b; is essentially a shortcut for a = a || b;.

The Logical OR Assignment (||=) operator is a handy tool when you want to assign a default or fallback value to a variable if the initial value of the variable is not truthy.

screenshot source

Logical Nullish Assignment (??=)





I asked Chat GPT to explain the operator to me like I’m 10:

Alright kiddo, let’s have a little chat about this nifty tool in JavaScript called the Nullish Coalescing Assignment Operator, which is represented by ??=. Sounds pretty fancy, huh? Don’t worry, we’ll make it fun!

Imagine you’re playing a game of football with your mates. Now, you always need a ball to play, right? But sometimes, you might forget to bring your own ball to the game. In comes the Nullish Coalescing Assignment operator to save the day.

So, let’s say myBall is the ball you bring, and spareBall is a ball that’s always kept at the ground just in case. Now, you want to check if you’ve brought your ball. If you have, great, we use your ball (myBall) for the game. But, if you forgot your ball (meaning myBall is null or undefined), we then use the spareBall.

In JavaScript, we’d write this check as myBall ??= spareBall;. This means, “If I forgot my ball (myBall), let’s use the spareBall.”

So that’s it, bachgen (that’s ‘boy’ in Welsh)! The Nullish Coalescing Assignment Operator is like your safety net, always making sure you have a ball to kick around!

Screenshot from WisdomGeek

Logical Assignment OperatorsLogical Operators
x ||= yx || (x = y)
x &&= yx && (x = y)
x ??= yx ?? (x = y);

Nullish coalescing operator (??) in JavaScript (2023)

I asked chat GPT to explain the Nullish coalescing operator (??) to me, like I’m 10 years old:

Let’s imagine you have two boxes, one is called ‘boxA’ and the other is ‘boxB’.

Now, you’re told you can take a toy from boxA, but here’s the thing, sometimes boxA can be empty. If boxA is empty, you’re allowed to take a toy from boxB instead.

In JavaScript, this is what the nullish coalescing operator (??) does. If the value on its left side (boxA) is “null” or “undefined” (it’s empty), it’ll give you the value on the right side (boxB).

Let’s look at this in code:

let boxA = null;
let boxB = "Dinosaur Toy";

let myToy = boxA ?? boxB;
console.log(myToy);  // This will print: Dinosaur Toy

In this example, ‘boxA’ is null (it’s empty), so we move to ‘boxB’ and take the “Dinosaur Toy”.

But what if ‘boxA’ does have a toy?

let boxA = "Robot Toy";
let boxB = "Dinosaur Toy";

let myToy = boxA ?? boxB;
console.log(myToy);  // This will print: Robot Toy


Here, ‘boxA’ has a “Robot Toy”, so we take that and ignore what’s in ‘boxB’. It’s just like the rule we set at the start, we only check ‘boxB’ if ‘boxA’ is empty!

I hope that helps explain the nullish coalescing operator!

Notes from this video^

This operator works like the logical “or”, but is more strict

In this scenario, at the start of a game, the user has to provide the level of difficulty they want, and they also have the option of stating/providing at starting cash amount.

In this code, if they don’t provide a starting cash amount, they’ll get “500”

So the default for the “cash” is 500

If the user does provide a cash amount, then that gets used instead of the default.

Short Circuiting in JavaScript (2023)

I asked Chat GPT to explain Short Circuting in JavaScript to me like I was 10.
I also asked for some jokes to be thrown in the mix.

“Hey there kiddo! You know how when you’re playing video games and there’s a super long level, but you discover a secret shortcut and skip straight to the end? Well, that’s kinda what we do in Javascript with something called “Short Circuiting”.

We use two super cool signs, “&&” and “||“.

Okay, first let’s talk about the two “ands” – “&&”. It’s like you and your best friend are on a secret mission. You both need to do your parts for the mission to be successful. If one of you fails, the mission fails. In Javascript, both sides of “&&” must be true for the whole thing to be true.

If the first part is false, Javascript doesn’t even bother to check the second part, because it already knows the mission failed! (this is the short-circuiting – it just quits)

Now, let’s talk about the two “ors” – “||“. This is like saying, you can have an ice cream OR a cake for dessert. If you get ice cream, that’s great! You don’t need the cake anymore (although, cake is always good).

Similarly, in Javascript, if the first part of “||” is true, Javascript takes the shortcut and doesn’t bother checking the second part.

Here’s a geeky joke for you: Why don’t programmers like nature? It has too many bugs! And don’t forget, always be like Javascript’s “&&” and “||”. Take the shortest path and save your energy for more video games! 😉”

Yea, so after reading that, I’m none the wiser, so here’s some notes from a video that I found on YouTube…

If price is more than 500 and less than 2000

Then print “hello”

If both operands are true, then print hello.

The “short circuit” occurs, because if the first parameter is not true, then JavaScript won’t bother running the second one.

So if the price was 400, and wasn’t greater than 500, then the JS would stop running and not bother to evaluate if the price is also less than 2000

It’s the same with the “or” operands, or operators, whatever they are called.

If the first condition is true, then it won’t bother running or looking at the second one, because with the “or” operator, only one of them has to be true.

Rest Pattern and parameters in Javascript

https://www.udemy.com/course/the-complete-javascript-course/learn/lecture/22648543#learning-tools

I asked Chat GPT to explain the rest pattern and parameters in JS to me, like I was 11, and to add some welsh slang:

“Alright, kiddo, let’s chat about Rest Pattern and Parameters in JavaScript, tidy la?

It’s like when you’re at a sweet shop, and they’ve got all these fab sweets – Choc bars, bonbons, chewy toffees, and so on. But you don’t want to pick ’em all up one by one, do you? That’d take ages, innit? Instead, you want to scoop ’em up all at once, don’t you?

Well, in JavaScript, we’ve got this clever trick called the Rest Pattern. It’s like that sweetie scoop. Instead of grabbing arguments one by one, you can grab all of them at once. You can see this Rest Pattern when you see ‘…’ before a variable, like this: function fun(...args) { }. The ‘args’ here is like our sweetie bag, it’s holding all the arguments that were scooped up.

Now, these Rest Parameters, they’re proper tidy! Because all those arguments are now in one bag (or in an array, as we say in JavaScript), you can do things to the whole lot of them at once – like adding, subtracting, or whatever else you fancy.

So, remember, next time you want to scoop up a load of arguments in one go, the Rest Pattern and Parameters are your best mates, alright? Proper job, bach!”

Here’s some notes from medium and geekforgeeks

The rest parameter, introduced in ES2015 or ES6, provides an enhanced method to handle function parameters. This makes it easier to manage a varying number of inputs as parameters in a function. A rest parameter lets us represent an indefinite number of arguments as an array, meaning a function can be called with any number of arguments, regardless of its original definition.

The syntax looks like this:

// '...' represents the rest parameter
function functionname(...parameters) {
  // function statement;
}


Notice when ‘…’ is at the end of the function parameters, it’s recognized as the rest parameter and stores any number of parameters as an array.

For example, let’s say we have a function without a rest parameter:

function fun(a, b){
    return a + b;
}
console.log(fun(1, 2)); // Outputs: 3
console.log(fun(1, 2, 3, 4, 5)); // Outputs: 3 

In this case, we can pass more arguments than defined parameters without causing errors. However, only the first two arguments are evaluated. The rest parameter changes this by allowing us to collect any number of arguments into an array:

// Example using the rest parameter
function fun(...input){
    let sum = 0;
    for(let i of input){
        sum += i;
    }
    return sum;
}
console.log(fun(1,2)); // Outputs: 3
console.log(fun(1,2,3)); // Outputs: 6
console.log(fun(1,2,3,4,5)); // Outputs: 15 

Now, every argument is included when we call the ‘fun()’ function. The sum of all array elements is calculated using the ‘for..of’ loop.

Remember, the rest parameter must always be the last argument in a function, as it collects all remaining arguments into an array.

Here’s an example where the rest parameter is used with other arguments:

function fun(a,b,...c){
    console.log(`${a} ${b}`);
    console.log(c);
    console.log(c[0]);
    console.log(c.length);
    console.log(c.indexOf('Lionel'));
}
fun('Mukul','Latiyan','Lionel','Messi','Barcelona');

Output:





In this example, the rest parameter is passed as the third parameter. The first two arguments are treated normally, while the rest are collected by the rest parameter. Because the rest parameter produces an array, we can apply array methods provided by JavaScript.

Easy Way to Analyse DOM Size (For SEO Audits & Speed etc)

Add the chrome extension here – https://chrome.google.com/webstore/detail/dom-size-analyzer/mcneiimlodlbmohipgdbbglgbmaoojen

when you right click > Inspect

In the menu with the two arrows >> – you can click that and it has an option to analyze the DOM – which then gives you the number of elements and a few other bits

Just click the arrows, and then “Analyze DOM Size” and click the play icon

  • You can also right-click and inspect and type:

SEO Reports in Google Analytics 4 (GA4) [2023]

SEO Landing Page Report

Go to Reports > Engagement>Pages and screens

click the pencil icon to customize

Click Dimensions – search and add “Landing page + query string”

Delete other dimensions

Click APply

Click MEtrics

Remove “views”

Add “sessions”

Drag sessions to top.

Click Apply

Click “Add filter” on the right

Search for/add “session default channel group”

Tick “organic”

Click “OK”

Click Save on the top middle-right

Click “Save as new report”

Name is “Landing Pages – Organic” or something

To get the report to appear in the sidebar menu

Click Reports in the left-side bar and then “Library “

Under “life cycle”

click “Edit collection”

Click “Create New Topic”

On the right search for the Landing Page – Organic report

Drag it into the new SEO folder you made (sometimes this doesn’t work as GA4 has a bug at the time of writing)

It worked for me when I dropped it into the second rectangle

Click “back” on the top left

and you should now see an SEO section to the reports.

“SEO Report 2 – Devices or Organic Search Traffic

Go to the Reports>User>Tech >Tech details

Click the Pencil icon to edit the report

Add a filter

Add “session default channel group”

and then Tick “organic” (search for it, if it’s not there for some reason)

Go to Dimensions in the right side bar

Click the 3 dots next to “device category”

Choose “set as default”

Then drag “device category” to the top

Click “Apply”

Click “Save”

Save as a new report

Name it – “Tech details – Organic” or something

  • at the time of writing GA4 is buggy as f*ck, and it won’t let me save this report

Go back

Go to Reports > Library (folder icon near bottom)

Add to the Life Cycle collection

Drag the report into the SEO folder.

SEO Report 3 – Search Engines

Go to Reports>Acquisition>Traffic acquisition

Click the pencil icon to customise the report

Delete on the dimensions in the top right, except for “Session Source”

Click Apply

Add a filter – session default channel group and then select “organic Search”:

Go to reports – click “library” icon at the bottom

Edit the life cycle reports

drag in the new report to the “SEO” section you made for the first report

Google Search Console Reports

Link GA 4 to Search Console

Go to Admin (blue and white cog incon on bottom left of screen)

On the bottom right click “search console links”

Choose the account and web stream and you’re done.

You might need to wait 24 hours for the data to get imported.

Go to Reports > Library (folder icon near bottom)

Life cycle – edit collection

In the top right search for “Google”

You should see 2 reports – Google organic saerch traffic and Queries: organic Google search queries

Click Save – save current collection

SEO Behaviour Exploration Report

Go to “EXPLORE>Path exploration > Start over (top right)

Click the starting point and then select / for homepage

Filter to show organic traffic only

Go to SEGEMENTs (left hand side)

Click the + icon

Click “Session segment”

Click “Add new condition” on the left – add “session default channel group”

Add filter by clicking the box on the right – contains – organic search – click “apply”

Name is “organic search visitors” – “Save and apply”

You can’t add this report to the sidebar (sorry) – so to see it you’ll have to always click into the Explore section.

The Spread Operator in JavaScript (explained in cockney)

TLDR; – The Spread operator allows you to join strings or arrays together in one longer string or array

Image from Reddit

Good tutorial here

Right, guv’nor! Picture this. You’ve got yourself a box of LEGOs, like? Now in the world of JavaScript, this box is what we’d call an array. It’s a list of things, sorted and lined up all proper like.

Now, suppose you have another bigger box, crammed full of all sorts of knick-knacks. You fancy bunging your LEGOs in there, but not as a separate box. Nah, you want to spread ’em out so each LEGO is jumbled up with the other toys.

This is what the JavaScript spread operator is all about. It’s like taking your box of LEGOs and tipping ’em into the larger toy box.

Here’s a little squiz:

let legos = ['red', 'blue', 'green'];
let otherToys = ['doll', 'car', ...legos, 'ball'];

console.log(otherToys); 
// Output: ['doll', 'car', 'red', 'blue', 'green', 'ball']

In this case, ...legos is using the spread operator. It’s like we’re tipping out all the LEGO pieces (each colour) into the otherToys array. Job’s a good ‘un!

So the spread operator ... in JavaScript is like spilling the beans, it pulls all elements from an array (or all properties from an object), and scatters them into something else.

And remember, this operator doesn’t muck about with the original array (or your LEGO box). It’s like taking the LEGO pieces out for a bit of a lark. The original LEGO box is still there, untouched. Bob’s your uncle, Fanny’s your aunt!

Here are some other notes I’ve robbed from other websites (with references back to um tho)

Programiz.com

Spread Operator

The spread operator ... is used to expand or spread an iterable or an array. For example,

const arrValue = [‘My’, ‘name’, ‘is’, ‘Jack’];

console.log(arrValue); // [“My”, “name”, “is”, “Jack”]
console.log(…arrValue); // My name is Jack

In this case, the code:

console.log(...arrValue)

is equivalent to:

console.log('My', 'name', 'is', 'Jack')

Copy Array Using Spread Operator

You can also use the spread syntax ... to copy the items into a single array. For example,

const arr1 = ['one', 'two'];
const arr2 = [...arr1, 'three', 'four', 'five'];

console.log(arr2); 
//  Output:
//  ["one", "two", "three", "four", "five"]

You can run the code in the programiz code runner thing here

codingsumit

Destructing Arrays in JavaScript (2023)

Destructing an array sounds fun, but it’s not.

When we talk about “destructuring” an array, we’re referring to a process where we extract data from arrays, and assign them to variables in a single line. Here’s a basic example:





let array = [1, 2, 3, 4, 5];

// Destructuring the array
let [a, b, c, d, e] = array;

console.log(a); // Output: 1
console.log(b); // Output: 2
console.log(c); // Output: 3
console.log(d); // Output: 4
console.log(e); // Output: 5

In the above code, we’re taking an array of numbers, and using destructuring to assign each number to a variable (a, b, c, d, e).

You can also selectively choose which elements to extract. For example:

let array = ['apple', 'banana', 'cherry', 'dates', 'elderberry'];

// Destructuring the array
let [fruit1, , fruit3] = array;

console.log(fruit1); // Output: apple
console.log(fruit3); // Output: cherry

In this example, we're extracting the first and third elements from the array, while skipping the second element.

"Destructuring" can be particularly useful when you want to quickly access specific data in an array or an object without having to access them using their indexes or keys, respectively.

So, think about breaking the array apart, when you’re thinking about “destructing”

Examples from scaler.com

  • Array Destructuring:




var a, b;
[a, b] = [5, 10];
console.log(a); // 5
console.log(b); // 10
  • Object Destructuring:
({ a, b} = { a: 5, b: 10 });
console.log(a); // 5
console.log(b); // 10

JavaScript Loops – Looping Backwards & Loops in Loops

Notes taken from The Complete JavaScript Course 2023: From Zero to Expert! course on Udemy.

Why would you use a for loop?

I asked Chat GPT this very question, and got this answer:

In JavaScript, a “for” loop is a control flow statement that allows you to execute a block of code a certain number of times. The “for” loop includes initialization, a condition, and incrementation/decrementation.

Here are some reasons and scenarios for using a “for” loop:

  1. Iterating over arrays: You might use a “for” loop when you need to iterate over an array of elements. Each loop iteration corresponds to one element in the array, so you can do something with each individual item.
    Example:
    let arr = [1, 2, 3, 4, 5]; for (let i = 0; i < arr.length; i++) { console.log(arr[i]); // prints each element of the array }
  2. Repetitive tasks: You would use a “for” loop when you need to perform a task a certain number of times. The “for” loop is a straightforward way to repeat a task.

    Example:
    for (let i = 0; i < 10; i++) { console.log(i); // prints numbers 0 to 9 }
  3. Traversing strings: Similar to arrays, you can use a “for” loop to traverse each character in a string.

    Example:
    let str = "Hello, World!"; for (let i = 0; i < str.length; i++) { console.log(str[i]); // prints each character in the string }
  4. Nested loops: You can use “for” loops inside other “for” loops when dealing with multi-dimensional data, such as a matrix or 2D array.
    Example:
    let matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; for (let i = 0; i < matrix.length; i++) { for (let j = 0; j < matrix[i].length; j++) { console.log(matrix[i][j]);
    // prints each element in the matrix } }

Please note that while “for” loops are a classic control flow mechanism, there are other methods in JavaScript for similar use-cases, especially for arrays. This includes methods like Array.prototype.forEach, Array.prototype.map, Array.prototype.filter, and others, which might provide cleaner and more readable code in some scenarios. However, understanding the workings of a “for” loop is fundamental for programming in JavaScript and many other languages.

What are for loops?

Loops, by default, start at the beginning of an array, and work forwards, from variable/element 0 to element 10 – if an array has 10 elements.

Loops can also start at the end, say element 10 and work back to the first element.

for (let i = arrayname.length - 1; i>=0; i--)

In the code above.
The counter called “i” will keep running along as the variable/element is greater than or equal to 0 (the variable number, as in it’s order starting from 0)

Every time the loop runs, instead of adding 1 to “i”, subtract 1.

To print the current element to the console.log, the code should be:

for (let i = arrayname.length - 1; i>=0; i--) {
console.log(jonas[i]);
}

This image from kodify.net explains the parts of a standard for loop quite nicely

for loop

Loop inside a Loop

Loops within loops, are sometimes called “nested loops”.

Image Source

With a nested loop, the outer loop executes first, and the inner loop executes each time the outer loop executes.

If condition 1 is true, then condition 2 will execute.

For a much better explanation, please visit the educba.com website here.

Oh, one more thing that might be useful, I asked Chat GPT to explain for loops like I’m 10 years old:

“Imagine you have a big box of Lego blocks, and you want to look at each block one by one. You would start from the first block, then move to the second, then the third, and so on, until you’ve seen all the blocks. A “for” loop in JavaScript is like doing that – it’s a way for your computer to look at or do something with each item in a list, one at a time, from start to finish.

Here’s a real-life example:

Let’s say you’re on a website that shows all the movies currently playing in theaters. When the website wants to show you all the movie names, it might have a list (in programming, we call this an array) of all those movies. But how does it get from a list of movies to showing each one on your screen? It can use a “for” loop!

In the code of the website, it might look something like this:

let movies = ["Toy Story 4", "The Lion King", "Frozen 2", "Star Wars: The Rise of Skywalker"]; // This is the list of movies.

for (let i = 0; i < movies.length; i++) {
  console.log(movies[i]); // This will show each movie name, one after the other.
}

In this example, i is like a pointer that starts at the beginning of the list (0) and moves one step forward each time the loop runs (i++). The loop keeps going as long as i is less than the length of the list (i < movies.length). And in each loop, movies[i] is how we access each movie name.

This “for” loop helps the website to go through every movie in the list and do something with it – like showing it on your screen!”

Google Analytics 4 Tutorial (GA4 Benefits & Useful Reports) [Updated June 2023]

TLDR;

Useful report 1 – Traffic and Revenue by Channel

Reports – Acquisition – Traffic Acquisition – see channels and revenue – Scroll right to see revenue column in table:

Useful Report 2 – Browser & Device

Reports – User – Tech – Tech details – Add filter for Device:

GA 4 device and browser report

Useful Report 3 – Organic Landing Page Report in GA 4:

Reports – Acquisition – Engagement – Pages and screens –
Add a filter by clicking top right “+” button
Search for “session” and choose session default channel group – exactly matches – Organic search:

Useful Report 4 – Conversion Rate

Check out this post from Analytics Mania

Reports – Life Cycle – Engagement – Pages and SCreens:

GA4 uses events for bloody everything.

You’ll need to set up one type of events – conversions, whilst others are set up for you.

Benefits of GA 4 Include:

  • You can track across app and website
  • Visualise buyer journeys easier
  • Easier to customise reports
  • BigQuery Exports
  • You can ask questions and get quick answers (in the search box at the top)

Things to note:

“bounce rate” in GA4 – is the opposite of engagement rate. So if engagement rate in GA4 is 60%, then bounce rate is 40%

Find Engagement rate in REPORTS > Acquisition > Traffic acquisition

You can add a filter (top left of screen – by the page title) – to filter to specific pages

GA4 Home screen

The home screen gives you a summary or snap shot of your websites performance.

On the top right are real time stats

On the second row, you have recently viewed reports

Below is “insights”, which help you interpret the data

Reports

Reports tab gives a number of prebuilt reports:

Lifecycle Reports

-Acquisition

Where visitors are coming from

-Engagement

What people are doing on the site

-Monetization

What people are buying (on eCommerce sites)

-Demographics and tech

Shows you stuff like visitor age, and what device they are using

EXPLORE SECTION

in this area you can create lots of visuals and insightful reports

ADVERTISING SECTION

purely for Google ads reports

CONFIGURATION SECTION

in the configure section, you can mark events as conversions, create audiences , set up custom dimensions and metrics, and access the debug view to test you’ve implemented stuff correctly.

Useful reports

Traffic sources – where are your visitors coming from, and where are the best visitors coming from

Reports- Acquisition > traffic acquisition

“Engaged traffic” an engaged session = been on your site more than 10 seconds, or visited 2 or more pages or converted

the traffic acquisition report let’s you see how engaged different source s of traffic are. For example, you can compare organic engagement rate vs paid ads.

in the Event Count, and conversions columns, you can click and choose from a dropdown menu which conversions you want to populate the data in the table.

EXPLORE

Explore GA4

A good report to start out with in the explore section, is traffic sources.

Click “Free Form” to start.

On the default table, close the geo column by closing “town/city” on the left side of the screen

Go to DIMENSIONS on the left, click the +

Search for “default channel group” and tick the check box and click “IMPORT”

drag default channel grouping, into the rows area.

Now, for eCommerce, you’ll want to know the value each channel is bringing

On the left side, under VALUES, you’ll want to add transactions (scroll down to see VALUES, it’s below COLUMNS).

EXPLORE > FREE FROM

you can add country and other dimensions to the columns, and see which traffic source from which country (or town or something), drives the most value in terms of purchases or form submissions.

To learn more and isolate a channel, right click and select “include only selected”

for any referral traffic report, you can click the + above DIMENSIONS and search for and select “source”. You can then see which websites are referring the highest quality traffic

click the + icons to search for variables:

PATH EXPLORATION

see how people are journeying through you site

note “screens” is referring to mobile apps

e.g. the pages and screens report, “screens” refers to mobile apps

Useful premade reports:

REPORTING > ENGAGEMENT > PAGES AND SCREENS

“Scrolls” is an event that occurs when a user scrolls past 90% of the page

pretty much everything is an event, so event reports aren’t great. For example, exiting a website is an event.

to make thus report a bit better, we want “engagement rate” added to the table.

  • click the pencil icon in

REPORTS – Snapshot

You can add comparisons, by clicking “Add comparison +” at the top, or by clicking the “edit comparisons” icon which is near the top right:

REAL TIME

Real time reports are from the last 30 minutes (it was 5 mins in GA universal)

You can also add comparisons on realtime reports

ACQUISITION OVERVIEW

These report, show traffic sources that bring visitors to your site

“You can use the User acquisition report to get insights into how new users find your website or app for the first time. The report differs from the Traffic acquisition report, which focuses on where new sessions came from, regardless of whether the user is new or returning.”

source – Google

In the traffic acquisition report, if a user comes from organic search, and then later from paid search, both those sessions will show in the traffic acquisition report, but only organic would should in the User Acquisition report.

ENGAGEMENT

Events – you will see automatic events, like “scroll”, and custom events that you have implemented.

Conversions – “more important events” are conversions – like a purchase. These need to be configured manually.

Pages and Screens – see what people are doing on which pages. “Screens” is a term for mobile apps.

MONETIZATION

Needs sales tracking implemented.

You can see most popular proucts that have sold, how much revenue has been generated etc.

User Retention – Show how many users come back to the site. Don’t trust the data 100% due to cookies being blocked or expiring.

One more thing

You can filter reports by using the search box:

Also – Check out this GA4 course from Analytics Mania