#186 New Features  That Make Your Life Easier Template Literals

#186 New Features That Make Your Life Easier Template Literals


In this chapter you’re going to learn new features in iOS 6 which were designed to make your programming life easier. These features they touch on a variety of aspects in the javascript language and have chosen to combine them in one chapter to make the course structure really easy to navigate through these features they touch on data types like strings they touch on objects functions arrays and so on. So first we’re going to start with templates Liberals first. We’re gonna go back to iOS 5 and have a quick quick example where you had to concatenate strings so let’s define a couple of variables. First name and last name saving is five. If you want it to log. Hello. Followed by the first name and then the last name. You have to do something like this. Using the plus operator right. And this worked perfectly. Now in E6 there is a new feature which will make your programming experience a lot easier as expected and this feature is called the templates literally. So instead of concatenate in strings using a B plus operator you actually write the whole string using template later liberals. So you’ll find this character of the bottom left hand side of your keyboard. Close to the control button. So inside the template is liberals you can write your whole sentence like this. Hello First Name Last Name like this. Now you go back to your variables with a variable first name he’s gonna be surrounded with curly brackets and you place a dollar sign just before it’s on the same thing. Same thing happens to this one any place at all a sign just before and now if you try this it works just like that’s one. So you can see like this since X now is a lot easier. Now there is something else that template strings will help you do in iOS 6. That’s where it’s when it comes to multi line strings. So for example in years 5 if you wanted to create a string it’s quick text 5 where you’ve got a line return. So you have to do some something like this. So here is a new line and where you wanted to start a new line you had to place a backslash and for a new line. Now in iOS in iOS 6 things are a lot easier. You can do this using templates laterals so instead of I’m gonna use const and this sentence can go inside templates liberals like this and rather than using the box light and we can just do a line return like this and it’s going to render us expected with a line written so you can see that template literally is a good example showing how E6 makes writing code a lot easier than before. There are many other features which we will explore in the coming videos.

► HTML5 & CSS3 Tutorial — 001 — Welcome Video! (w/ GeekDisorder)

► HTML5 & CSS3 Tutorial — 001 — Welcome Video! (w/ GeekDisorder)


Hello, welcome to Geek Disorder’s
HTML5, CSS3 and JavaScript/jQuery Series. This is Lavick, I’ll be walking you through the series. This is our welcome video. It’s going to cover
Who this series is for and What will it Cover? Alright. Who is this series for? This series is for people that may have never seen
HTML, CSS, or JavaScript / jQuery before. We will start with the very basics and work
our way up to some of the more advanced topics. This series is also for people that may have worked with xHTML, HTML, and CSS like the earlier versions like HTML4 . But may not know what’s new in HTML5 and CSS3. If you want to learn the basics of
JavaScript and jQuery this series is for you. We won’t be going into the more advanced
topics of Javascript and jQuery But Geek Disorder will be putting out a full series, on JavaScript and then a series on the Javascript libary jQuery in the future. What will this series cover? We’re going to cover HTML5, CSS3,
the basics of JavaScript and jQuery. And a quick overview of the series is. Well, we’re going to start with introduction to web development. That’s going to cover a basic overview of web development. The web development tools you can use. What you will need to actually complete this series. And special web development issues. We’re going to move on the introduction to HTML5,
like the structure of a web page, formating with CSS The CSS block model, laying out your web page with CSS. Some more intermediate topics of HTML5: Links, lists, images, tables, forms, audio, video
and formatting your page for printing. Then we’ll hit some of the more advanced
topics of HTML5 like JavaScript. We’ll introduce you to the JavaScript library jQuery. Also, we’ll introduce you to jQuery mobile. Make some good web pages for tablets, your phones, such as that. We’ll move on to some more advanced topics
in HTML5 and CSS3, like canvas. We’re going to touch on designing a web page. And then deploy your web site from your computer
onto the web site so everyone can see it. How in depth will this series be? Well, the HTML5, CSS3, and JavaScript / jQuery series
will be around 75 to 100 videos. each being 7 to 15 minutes in length on average. We’ll do our best to cover as much HTML5 and CSS3 as we can. If we miss something, just let us know. We will be more than happy to work on putting
out a video to cover it. Add it to the series. We will cover the basics of some of the more
advanced topics in HTML5/ CSS3 like I said canvas. We will definitely do another series that goes a lot
more in-depth on canvas and such in the future. We will cover the basics of JavaScript and jQuery. And putting out a full series that cover the more advanced
topics in Javascript jQuery in the future also. Well, this is Lavick with Geek Disorder. I’ll hope you all will enjoy this series. So, please. We’ll be putting out videos pretty regularly. So, please join us for our HTML5, CSS3,
and JavaScript/ jQuery series! Y’all have a good day.

The best way  to Install Google Analytics on to a WordPress Website?

The best way to Install Google Analytics on to a WordPress Website?


In this video, I’m going to show you the best method
on how to install Google Analytics on your WordPress website. All and more coming up.Hey,
there measuregeeks! Julian here back with another video teaching you the data-driven
way of digital marketing. Now, today we want to talk about how to install Google Analytics
on a WordPress website. And as always, there’s not just one way of doing things. So today,
I’m going to show you actually three ways on how to install Google Analytics on to your
WordPress website. And later on, you can pick which one suits you best. I will also give
you my recommendation at the end of this video. Now, we’ve got lots to cover so let’s dive
in.All right, welcome to our demo software we want to install Google Analytics on. Now,
in order to do this, we need to have two things in place already. First of all, we need to
have access to the admin area which we can reach under our domain name slash WP admin
login and now be able to install Google Analytics on your website. Be sure to have access to
the back end. Second part would be to have an actual tracking ID. And this is what you
can get at analytics.google.com login with your Google account, and then navigate to
the account that you want to install. If you don’t have an account set up, you will be
greeted with setting up a new account. Let’s quickly go through this. First of all, we
want to track a website. Let’s choose an account name. Normally, you would choose your company
name, then you can give your web property or the web tracking code a name. So for example,
for us, it would be our demo shop. And then you enter your website URL.In our case would
be right here. Now, be sure to not have the HTTP part up here at the beginning. You can
choose if you’re on HTTP or SSL in this drop-down menu. And then you can choose your industry
and also your reporting timezone. Now, this is very important because you want to ensure
that the timezone matches up with the timezone on your website to be able to compare data
later. So make sure that this is set correctly. And you can choose if you want to take part
in some more data options that Google Analytics provides. I’ll just leave them tick for now.
And we can now click on Get our tracking ID. We need to agree to the data processing terms.
This might differ from where you are located at. And I’ll accept this. And now we should
get our tracking code. We jump right into the section. Now if you already have an account
set up, you can simply go here to the admin section. And then on the property section,
you find the tracking info that you can open up and go to the tracking code.So you get
to the same place here. And here’s where we get our tracking ID that we will utilize to
install Google Analytics on our website. Let’s get to installing it. And I’m going to show
you three methods here. The first method is through a plugin. So we’ll go down here to
our plugins section and add a new plugin. And we simply type in Google Analytics. There
are different plugins out there that will help you to install Google Analytics or choose
the most popular option which is the Google analytics dashboard plugin for WordPress by
monster insights. So let’s install this and activated and will put us in this setup screen.
And we simply follow along with our Setup Manager here will connect monster insights
to our Google Analytics. It will authenticate us to Google, we allow the settings and then
we can choose our account. In our case, we had our tracking ID already available here,
just going to copy this. And we’ll find here our view that we want to connect. And we will
complete the connection. We can choose different tracking options. I will leave them untouched
for now. But this is really about the customization of your tracking code. And that should do
it we exit our wizard. And we should have now Google Analytics installed as easy as
that. How can we verify that this is actually working?Well, one is an extension by Google
that you can install to your Chrome browser which is the Google Tag assistant. And we
see here that Google Analytics is installed, but there is no HTTP response. And this is
because Google Analytics is actually blocked for people who are admins and logged in to
WordPress at the moment. So let’s open up a private browsing mode here. And I’m just
going to navigate to my page. And now we are not logged in. And we can see here, Google
Analytics is now deployed. Now depending on if this green or blue, this doesn’t really
matter. But it seems like Google Analytics has been deployed correctly. We can also test
this by going into our Google Analytics here. And here we see the status. And what we can
do is test our implementation by going into the real-time traffic reports through this
link. And here you can see that a page view was just generated. So this means that the
user that is right now on the website which is us has generated a page view. So if we
would go to the next page here should have another page view enter the picture. So Google
Analytics is correctly installed. And this is our first method of how we can install
Google Analytics via a plugin. I’d recommend this for everyone who doesn’t want to get
technical and install Google Analytics in a very easy way. But the downsides might be
that you have to install an additional plugin. This can potentially bog down your WordPress
installation and slow down your page. So I want to show you another method of how you
can install Google Analytics on your website. And this is through the installation in the
theme files directly. So let’s head back into our WordPress back end. And I’m going to deactivate
our plugin.And now let’s go ahead and install Google Analytics again through the theme files.
For that will go over to appearance, then theme editor. Now as it says here, it’s recommended
that you have a child theme already set up that will let you install these codes into
your child theme so that don’t get overwritten next time your theme updates. So definitely
have a child theme set up first, then we can go ahead and proceed here. Click on I understand,
select your child theme. And then find the header.php. Now, this needs to be set up in
your child theme in order to edit this. So we’re going to click on it. And now we have
access to the theme that governs our website, and especially the header of that theme. Now,
we go back to Google Analytics and click back into our tracking information to get our tracking
code. And here we have the global site tag, we can just simply copy. And it says here
that we should install this in the head section. So with our theme open right here, we can
add our information.And I’d suggest to put this right under the meta tags right here.
Just paste this in. The earlier the Google Analytics code will fire, the more likely
it is to send data of so even if the user navigates on before the site has ended loading,
you’ll be able to capture information. So now that we have this setup, let’s update
our file and head back to our page. Now, we should see in our tag assistant, the global
site tag is installed and Google Analytics so it’s already sending data over. Let’s look
into our real-time reporting inside of Google Analytics. And here, we also see that there
are page views already generated. If we go on to another page here, we should again see
data coming in right here we see a new page view. So Google Analytics is installed correctly
for our page. And this was also an easy method to install. If you are comfortable with copy-pasting
code into your theme file if you have a child theme set up and don’t want to use a plugin
to install your Google Analytics on your page. Now let’s go on to the last method that I
want to show you. And this is installing Google Analytics through Google Tag Manager. Now
Google Tag Manager is a tag management tool. So it manages all your tracking in one central
place. And this is a Google Tag Manager container. To get started with Google Tag Manager, head
over to tagmanager.google.com and create a new account, you can follow the steps as we’ve
done before in our Google Analytics set up. So we had your company here, and then your
website.You’re going to go with web, and create this and then we’re entering our Google Tag
Manager container. Now the first thing that we need to do, we also need to install a container
snippet onto our page into our theme files just like we did before. So let’s get go ahead
and follow again the steps that we just did earlier, I’m going to copy the first code
that needs to be in the head section. We’re going to go into to our theme settings and
our theme editor, choose our child theme here, go into our theme header PHP. And this time,
I’m going to get rid of our global site tag that we have installed right here. Instead,
paste our code of Google Tag Manager. Then there is a second code that we need to place
beneath the opening body tag. So we’re going to look for the body where it starts right
here. And right underneath going to post our Google Tag Manager, no script tag. Let’s update
this file.Now we can head back to our page, reload that. And in our tagging system, we
see that we have Google Tag Manager now installed. But Google Analytics is actually not yet part
of this implementation. We will need to deploy Google Analytics through Google Tag Manager.
How do you do this? Well, in Google Tag Manager now, you have access to the website itself
through that central snippet that we’ve installed on all the pages. We just need to deploy the
tracking tool that we want to install through this Management Console. And you do this by
going into Google Tag Manager and clicking on new tag and give this all a name. So we’ll
be able to recognize this later. And then when we click on tag configurations, we can
see all the different tools that you can install through Google Tag Manager onto your page.
Now, we are interested in Google Analytics, which is right on the top right here. So I’m
going to click on that. And we want to set over a page view, Now, we need to specify
the account which we can do by setting up a new Google Analytics settings variable.Here,
we need to implement our tracking ID. Go over to Google Analytics, go into our tracking
information and copy the tracking ID right here. Go back to Google Tag Manager, paste
it in here. I’ll also take this as a name here. So I will be able to recognize this
later. Let’s save this. And this is really what we would need, we just need to define
a trigger right here. And there’s already one available which is the all pages trigger.
So it will be deployed on all the pages. Let me fix this typo up here. And we are good
to go. Let’s save this. And now we have implemented one tag into our tag manager. We can try this
all out by going into the preview mode. This will put our browser into a special mode.
So we will be able on our page when we reload our page to see a debug console down here
which will show us which tag have fired on our page. Very practical to see if your tracking
is actually deployed. And he will see our Google Analytics is deployed, we can also
cross check this in our tag assistant. Here we go. The tag assistant shows that Google
Analytics is deployed. And also in our real-time reporting. There’s one user right now. And
here we go our page was sent and received by Google Analytics.Now be aware once we’re
in the preview mode, this is actually only deployed for you on your browser. This is
not yet live on your website. In order to push this live to the website, we will need
to submit a version. This is what this big Submit button is for click on here and we
can give our version a name. So you’ll be able to see all the changes we have done to
our container later on. Let’s publish this and it’s should be now live on our website.
So if I go back here and leave the preview mode, reload our page, you now see Google
Analytics is installed and Google Tag Manager. Now, don’t worry if those are not green. This
just means that it’s a nonstandard implementation since you have done it through Google Tag
Manager. But your data is still safely sent and received by Google Analytics.Now you have
seen that we have gone through quite some steps in order to set this up with Google
Tag Manager. The big advantage to this setup is that you will be more flexible once you
want to do customization and really get into advanced tracking techniques. Because not
only can you deploy easily Google Analytics, but also your facebook pixel, Google Ads tracking,
conversion tracking, or even set up certain triggers that trigger on interactions such
as a button click or when something comes into view, or form Submit. So very versatile
when it comes to expanding your tracking beyond the scope of just deploying a tracking code
like Google Analytics onto your page. It also decouples what you set up in your WordPress
installation. So if you ever wonder what tracking code is firing where you would be able to
look this up in your central tracking tool which is in this case, Google Tag Manager.
So for me, setting up Google Analytics through Google Tag Manager is the best way to set
up Google Analytics as it brings a lot of advantages of expanding our tracking later
on.All right, so there you have it. This is how you can install Google Analytics onto
your WordPress website. I showed you three ways. One is the plugin. One is to install
and hard code, essentially, the code onto your theme file, and then the deployment through
Google Tag Manager. Now, I made it already clear that I prefer the more hard way of doing
things, which is the deployment through Google Tag Manager just because it makes me more
flexible later on. If I want to install the Facebook pixel or Google Ads tracking later
on, then I’d be able to do this seamlessly through Google Tag Manager. There are a lot
of advantages. And if you want to find out more about Google Tag Manager, we actually
have a Google Tag Manager for beginners course up right here that you can view and learn
more about now. I’d love to hear from you. Which implementation method did you pick?
Or will you change your implementation method right now onto your WordPress website? Let
me know in the comments down below. And as always, if you liked this video, why not give
us a thumbs up and also subscribe to our channel right over there because we bring you new
videos just like this one every week. Now, my name is Julian till next time.

#81  Page Structure & Styling 3 Using Html Css JavaScript

#81 Page Structure & Styling 3 Using Html Css JavaScript


All right now let’s style our books is when they are active. So when we click on a box we can see lots first of all the shadow disappears. OK. And also the position of the box goes down a little bit so that it covers the original space occupied by the shuttle which means that it goes down by four pixels the vertical value of our original shadow so to style the boxes is when they see if we are going to access the valks glass. OK. And then call on active and just make sure that there is no space between Conan and text. So first of all the books shadow property is going to change. OK. So both values this time are going to be zero. OK we can do the color. And also to make the box go down by 4 pixels. We’re going to use the top position or the top property but we’re going to set to four pixels but we’re going to need to give our box a position of relative. OK. So it’s like the box actually is moving relative to its original position. OK. So let’s try this. We can see that the box goes down by 4 pixels and the shadow disappears on us. If we look at the final page we will see that’s the box when we click on it it takes some time. Can we can see a transition effects before it goes down. All right. So you’re going to do going to use a transition property. OK. Like we did before in the first projects the prop they’re going to be looking us here is going to be both the box shadow. OK. And the top position but we can just go for all which means that we’re looking at all the properties of that specific item OK for the duration we’re going to go for point two seconds. OK. And we’re not going to specify any timing function of Ueno because it’s optional right. So now when we click on the box is refresh the save and refresh. Can you see this transition effects. And I can see the position effect. OK. One important point like we did in the previous projects we’re going to need to add a few more lines for the transition property. OK for cross-browser compatibility. And we’re going to add something just before the transition Wed. So we’re going to have kids. Okay. And then was when was the lower and for Oprah and miss for instance is explorer and it’s okay for the books Chido we need to do the same thing but only for Safari and Mozilla so wherever we used book Shadow we need to add a couple of lines one for Safari and one for Mozilla. OK so I’m going to do it for the first one. OK. And then we’re going to pose and wait for the other ones. Make sure we do the same on your own so. So I’m going to add this one for and this one way tickets for Safari. OK. So now I’ve got these couple of lines added to all my books shadow properties. OK. OK so just make sure that you do the same. OK. Now we’re going to move to the start reset button. OK. So we’re going to be creating a diff following the choices Dave. And we’re going to give it an ID starts resets unless I’m going to play some texta Stars game now let’s dial this live if we look at our stars recess Musson will see that most of the properties of the button are very similar to the properties of the box class. OK so we’re going to do we aren’t going to copy the properties of the books class into the styling of the stars. Reset Button. And then we are going to adjust the styling for the button. OK. So let’s take out a few properties we don’t need like the line height gay or the height. If Lote’s property OK we don’t really need. Right. Well you don’t need the margin property to center the button so you cannot go for a top and bottom margins of 0 and 0.04 left and right. OK. And now it sounds it also going to add some padding it’s good for 10 pixels and the background color. We’re going to change it. Basically this is a white transparence color and it looks like this because the color behind it is blue . OK. So again I use the IGDA function. OK. I’m going to use the values corresponding to white and then I’m going to go for point five for the transparency K for the with. Let’s make it a little bit smaller. Even smaller than that and make sure that the text is still going to fit the and resets game. See C it’s fine. OK. Now we are going to Tiley over an axiom states of the stars. OK so we need exactly the same properties of the Hoven actually states of the box class. So all we going to do is going to add another selector next to the box Hoven selector. OK. Are these Tarth resets wasn’t going to be going on over. And similarly with the same thing with the active States. OK . All right. Now let’s add our time remaining box. So this goes to our indexers H.M.S. file and creates a new div following our stars reset button and give it an ID time remaining. OK. So inside this div we’re going to play some text. Ok so time remaining 60 seconds. So I’m going to place the number inside a span and give it an ID. Time remaining value. So we’ll use the ID later on with javascript’s to access this value and change it. OK. OK. Now let’s go to the stunning sheet and style the time remaining box. So going to access is using its ID which is time remaining all right. So let’s give it some weight and putting them in position is in our container. So it’s so first of all give is a width of 200 pixels and a putting of about 10 pixels. OK. And let’s position is inside our containers are going to give us a position as butes absolutes. Okay. And then are going to give it a top property of 300 pixels. Fifty four hundred ok or a little bit less. Three hundred ninety five. OK. And a left position or left property of 300 or 400. OK let’s change the width to 150 is make it slightly bigger. OK you explain. Now let’s add some background color. OK. So if you want to get the same color as does this color is created using the ICBA function. OK so we’re going to use a green color with some transparency. OK. So I’m going to use the IDBI function. So I’m going to use three values as following 1 8 1 2 3 5 and then 3 6 and then I’m going to add some transparency over pay zero 0.8 OK or a little bit less than that’s your point seventy 78. OK. Continue the color if you want to you can use the control alt K method and this says the transparency using the slider. OK. You can choose any color you want. OK . Now let’s tile the corners and just add some more the radius. OK it is go for 2 pixels 3. OK. So that’s some valks shadow. So again I’m going to use Zerbe cells with the horizontal value and 4 pixels with a vertical one earning . We’re going to use a gray color for the shadow. OK so we’re going to use the Ojibway function again. So going to use the black color. OK. And then we’re going to use a transparency of white to that looks. OK. Now we all need to hide the time remaining div initially. OK so we can use either the display property or the visibility property we have used the display property earlier with the correct and try again boxes. So let’s use the visibility property this time to learn both. So when we use the visibility we are going to set it to hit it. OK something for you to remember the difference between the visibility hidden and the display on properties is that if we apply visibility hidden to a certain elements in our page that element is still going to be present in the page. OK. And he’s going to interact with the other elements. So at the moment this one is not interaction with the other elements only because it’s got a position property of absolutes creates all the other elements are behaving as if doesn’t exist at all. OK the display on property is going to hide the elements and the elements is not going to end tracks any more with other elements. OK. All right now though we understood the difference let’s just use the display property to make it easy to standardize all the functions in our code. Later on when we are writing javascript’s. When I said display to none. And I’m just going to comment this one so they can amendments. OK

How to Install Google Tag Manager (2019) | Lesson 2 (GTM for Beginners)

How to Install Google Tag Manager (2019) | Lesson 2 (GTM for Beginners)


In this video, I’m going to show you how you
can install Google Tag Manager correctly on your website. All and more coming up. Hey there and welcome back to another video
of measureschool.com teaching you the data-driven way of digital marketing. My name is Julian. And this is our second lesson of our beginner
series of Google Tag Manager. If you haven’t seen our first lesson, then
head back where we give you a little bit of an overview on Google Tag Manager. Link will be in the description below. In this lesson, I’m going to show you how
you can install Google Tag Manager correctly. And like last time, we have a little bit of
a quiz prepared for you after you’ve gone through this tutorial. You can test your knowledge at measureschool.com/lesson2. But for now, we got lots to cover. So let’s dive in. All right, today, our journey starts at tagmanager.google.com. This is the page that you can go to login
to your Google Tag Manager account. Now, you will need to have a Google account
in order to use Google Tag Manager which means if you already have a Gmail account, or a
YouTube account, or any account for the Google services, you most likely will be able to
use it here as well. I have a demo account here already set up,
you just enter your password. And then you are in, you can access Google
Tag Manager. Now, most likely, if you are completely new
to the system, you won’t see here anything. You will right away, go to this step. And this is where you start setting up your
Google Tag Manager account. Now Google Tag Manager accounts are divided
in the account level. And then the container level. You can have multiple accounts. And within that account, you can have multiple
containers. Now, Containers are really the snippets or
the central code that exists for your website. So best practice is to name your account after
your company. So for example, Demo Inc. Choose your country, then you can choose whether
you want to share data with Google. And if you click on continue, you go to the
container setup. Now, the container is something that is unique
for your website where you going to install Google Tag Manager. So I’d recommend to enter your website here, just the domain. Really doesn’t matter what you call the container
so you can recognize it later on, I would recommend the URL here. And afterward, you can use the container in
different instances. We will be installing Google Tag Manager on
the web. There’s also a container available for iOS,
Android, and AMP pages. But the setup of these is completely different
to what we are doing here on the web. Check out our other tutorials if you want
to learn more about these three other methods. We’ll go with web right here, and then create
our Google Tag Manager account. We need to adhere to some TOS. And if you have read this all you can accept
it, click yes here and your new Google Tag Manager account will be initiated. Once you have gone through the process, we
already greeted with our Google Tag Manager snippet. If you don’t see the snippet when you open
up your Google Tag Manager account, you can always click on your Google Tag Manager ID
up here. And it will open this window up as well. Now, this already gives us some installation
instructions. We need to place this part of the code in
the head section of our HTML and this part of the code in our body section of the HTML. Now, this will probably be the last snippet
or piece of code that you will need to install onto your website and you will need to have
some kind of greater access to the website itself in order to install this. There are different methods of installing
this code. So let me talk you through the options. First of all, if you have a developer working
on your website who is responsible for the technical infrastructure of the website, I
would consult with him in order to install those correctly. Secondly, if you have a CMS running a content
management system such as WordPress, Shopify, Magento, Joomla, or any other backend system
that actually generates your website, you might be able to install a plugin to install
these codes via plugins. There are many out there. I would just encourage you to take your CMS
system, for example, WordPress and then Google for Google Tag Manager installation on WordPress. And most likely there will be already a tutorial
that will explain the right setup. We also have some tutorials on some of the
content management systems here on this channel. Thirdly, you can also install this manually
on your website. If you have access to the code of your website
and feel comfortable doing this then I’ll lead you through the steps right now. This is probably what you do developer would
go through or what the plugin does in the background. As an example, I have a WordPress installation
right here. WordPress is the most used content management
system in the world. So if you are running a WordPress blog, you
can follow along with these instructions. But if you’re not running WordPress on your
website where you want to install Google Tag Manager, these instructions most likely will
differ. Now, content management systems are normally
governed by a theme which you can control the design of the website itself. Within WordPress, you can log into your back
end system, then go to Appearance right here. And under editor, you can see your different
themes that you have set up, but also have access to the theme files itself. Now, notice that I have set up a child theme
here because I don’t want my changes that are due to the theme files right here effect
when a new update comes up to the parent theme, which is storefront. So it’s a best practice to have a child theme
if you’re working in WordPress. I have this already set up. I’m going to go over here. And then I have my theme header file that
I can click on. This is a PHP file that governs all the different
sites that are generated by WordPress on my front end. And right here, I can see that there’s a head
tag that is generating my HTML. And then here’s the closing head tag. And then we have here the opening body tag
as well. Now, I can take my codes. First of all, the first code is in the head
section itself. I’m going to copy this go over to my theme. And I want to place it as high up as possible
into the HTML. This is important because the website itself
will get passed from top to bottom by the browser. And we want to fire our tracking codes with
Google Tag Manager as soon as possible so the likelihood of them firing is higher. So I’m going to place them directly under
the opening head tag here. And then I’m going to grab my second code,
go back to the theme files and look for the opening body tag which is right here. And right underneath and gonna paste my Google
Tag Manager code. Now, I’m going to update this file and it
should be written to my theme files. If this is not something that you can do in
your WordPress theme, then you might need to directly access these files via FTP in
order to change them. But now I should have Google Tag Manager installed. If I go over to my page, reload the page,
I can click right click and then view page source. And I can see the HTML of my website of how
its marked up. We have our Google Tag Manager code right
at the beginning here. And if we scroll down with all the generated
code by the CMS system, we should also find our no script part of Google Tag Manager,
which is right under the opening body tag in our HTML as well. So Google Tag Manager is correctly installed
on this website. Now, we can go through all the different sites
that we have on our website and look into the HTML, but it would be rather cumbersome. A better way of validating is simply to go
into the preview and debug mode. So in Google Tag Manager, we can put our browser
and only our browser into a special mode which will pop up a debug console down below. So I’m going to reload. And we see we have this popping up down here,
nothing fires at the moment. But this way, we can go through the pages. And just make sure that this pops up down
here in order for us to validate that Google Tag Manager is on all pages. And if you don’t see this tag manager console
pop up, you most likely haven’t installed Google Tag Manager correctly on your website. So just make sure that this is visible on
all the pages if you enter the preview mode inside of Google Tag Manager. So this seems to be working correctly. And we have installed Google Tag Manager and
now ready to deploy our first tags. But before we do so, I would encourage you
once you have set this up to actually submit the first version in Google Tag Manager in
order to initialize GTM correctly. Click on Publish. This will go live to all the users although
we have zero tags triggers and variables installed just yet. So this is how you can install Google Tag
Manager on your website. And now we are ready to deploy our first tag
with Google Tag Manager. All right, so there you have it. This is how you can install Google Tag Manager
on your website. If you think you understood everything, then
maybe test your knowledge at measureschool.com/lesson2 to where we have a little bit of a quiz prepared
for you, for you to go through and test your knowledge and see if you understood everything. And if you want to follow along with our Google
Tag Manager for beginners series, then why not subscribe to our channel right over there. Because we bring you a new lesson next week. Now, my name is Julian. See you on the next one.

Track Element Visibility with Google Tag Manager (feat. Julius Fed from AnalyticsMania)

Track Element Visibility with Google Tag Manager (feat. Julius Fed from AnalyticsMania)


– In this video, Julius is gonna show you how you can track elements that moved into the
viewport of the screen. All and more coming up. (upbeat music) Hey there and welcome to another video of MeasureSchool.com teaching you the tech tools and techniques of today’s digital marketing world. Now a while ago Google Analytics came out with a plugin called autotrack.js and it featured a tracking method that could detect whether an element moved into the visible part of the screen of the user’s browser. Unfortunately, this is only available within the plugin and you couldn’t really make it work with Google Tag Manager. But just recently I
came across a blog post by Julius from Analytics Mania who published a custom listener that would accomplish just the same thing. So I reached out to him and asked him if he could help us out and explain this listener to us and
how we can install it with Google Tag Manager. Luckily, he agreed and
made a video for us, so without further ado,
Julius, take it away. – [Julius] Thanks, Julian. In order to understand why this technique is important, I want to
illustrate it with an example. Here’s an article in my blog and let’s say that I want to track when
the visitor scrolls down to the very end of my
blog post right here. Unfortunately, I cannot use
the classic scroll tracking because it heavily
relies on the percentage of scroll distance. Since the length of each
blog post is different, some of them end at 85% mark, while others might end
at 95% mark and so on. As you can see, the
data might be inaccurate at this point. It would be much more accurate to say that the visitor reaches
the end of the blog post when he or she sees the name
of the author right here. And that’s where element
visibility tracking comes in handy in Google Tag Manager. In this video I’m gonna show you how to track elements when they appear on the screen after you scroll up or down. In order to do this, you’ll
need to complete three steps. The first step is to create and configure a custom auto-event listener. That listener will be looking
for particular elements or element to appear on the screen, and once that happens, the listener will dispatch a data layer event. The second step is to process the data of that event, and we’ll do that by creating a custom event trigger and data layer variables. And finally, the third
step is to send the data to Google Analytics, and we’ll do that by creating Universal Analytics tag. Okay, so the step number one is to get the JavaScript code of our
element visibility listener. You can find the link to the code in the description of this video and I’ll just get it from here. Select All, go to Google Tag Manager, create New Tag, and I’ll choose the custom HTML tag template. I’ll paste the code right now, and now I’ll name the tag cHTML. cHTML stands for custom HTML, and I’ll name the tag
Element Visibility Listener. Now let’s assign a trigger. The element visibility listener works when the entire content of the website is already loaded. That’s why All Pages trigger
will not work for us. We’ll need to create another one by clicking the plus icon here, and we’ll use a DOM Ready trigger. We are interested in all DOM Ready events and let’s name it Pageview – DOM Ready. Okay, so what we have so far is we have named the tag, we have the JavaScript code, and we have the trigger DOM Ready. But we’re not done yet. We still have three things to edit. By default this listener does not know which element or elements
do you wish to track, so we have to edit a CSS selector here. If you don’t know yet, a CSS selector is a pattern which let’s you pick a group of elements or just maybe
one element if you wish. I highly recommend learning
more about CSS selectors, but if you’re new to
it, here’s a quick way how to get started. So let’s go back to our website and inspect the author’s name. What we see here is that author’s name is actually H5 and its
class is author-title. So let’s enter this in our CSS selector. Let’s remove this placeholder and click H5.author-title. So with this CSS selector we are telling our listener to look for all H5 elements which have a class called author-title. But my recommendation is
to be a bit more specific and add at least one more rule to it, so we need to go back to our website and let’s take a look how we can make it a bit more specific. So what we see here is H5 element and it’s a direct child of a div with class author-info. So let’s enter that in
our CSS selector: div. Each CSS class must start with a dot, so we need to enter dot, and enter author-info. Press space. And we need to tell that H5 element must be a direct child of this div so we need to enter this symbol. So that’s it. Our auto-event listener will be looking for H5 elements with class author-title and that H5 element must be a direct child of div with class author-info. The next two lines that we need to edit are actually optional. If you want, you can delete
them just by removing this line and deleting this comma. You can also do the same with this line. But in this video I want to show you the full possibilities of this listener so let’s dive deeper. So when the element appears on the screen I can actually fetch the
value of that attribute. For example. Let’s go back to the
website and, as you can see, the author-title has
an additional attribute called additional data, so if I wanted to fetch its value, all I have to do is just to replace this
placeholder with additional-data, and I would also have to do the same here. So in this case, when the
element appears on screen, the event listener would fetch the value of this attribute. Currently it equals to image-123. But in my case this
attribute isn’t very helpful so actually I would like to
fetch the name of the author. So in that case I need
to replace this part with innerText, and do the same with the event called hidden. This way the auto-event
listener will fetch this text which is the name of the author. It would be especially useful if I had at least a couple of
other authors on my blog and when the author title
appears on the screen, the auto-event listener
would fetch author’s name. So that’s about it. Let’s save our Event Visibility Listener and enable preview and debug mode. Now let’s head over to our website, refresh the page, and at
the bottom of the screen you should see Google Tag Manager’s preview and debug console. Click DOM Ready event, and as you can see, our auto-event listener
was fired successfully. Now let’s scroll till the
very end of the blog post until we see author title. Yes, we can see that and, as you can see, in the event stream we
see a data layer event called elementVisibility. Let’s click it and head
over to Data Layer tab. Looks like everything
is working as expected. We see the event name, it’s
called elementVisibility. We have visibilityStatus, it’s shown, and elementAttribute is Julius Fed, as we have expected. So that’s it with the
step one, and now we need to process this data
in Google Tag Manager, and then we’ll send that
data to Google Analytics. By default, Google Tag
Manager does not recognize custom data which is
stored in the data layer. So if you were looking
for visibilityStatus, you couldn’t find it among variables. So we need to create
two data layer variables which are called visibilityStatus and elementAttribute. So let’s do that. Let’s go to the Variables section, and scroll down, and here
under User-Defined Variables we need to click the New button and create two data layer variables. Let’s enter a data layer variable name which must be equal to this value. So for example, visibilityStatus. Variable names are key
sensitive so make sure that the S letter is capital here. And let’s name the
variable, I call them dlv, this stands for data layer variable, and I’ll name it visibilityStatus. And let’s do the same
with another variable which should be called elementAttribute. Variable type is Data Layer Variable and variable name is elementAttribute. Let’s save. So that’s it with variables and now we need to create a trigger because we want to fire
a Google Analytics tag when element becomes visible. So we need to turn this data layer event into an actual trigger. So let’s go to Google
Tag Manager, Triggers, and let’s create a new trigger which is using trigger type Custom Event. And enter elementVisibility. This event name must be
exactly the same as this one. So make sure that V
letter is also capital. And let’s call the trigger
Custom – elementVisibility. Now what we need to do
is to test our variables and to see whether they
are fetched correctly. So refresh the preview and debug mode, then head over to the website and refresh. Let’s scroll down till the
very end of our blog post until we see the author title. Yes, here it is. Let’s click the elementVisibility event, go to Data Layer, and just double-check whether all data points
are displayed correctly. So everything works as expected. Now let’s head over to
Variables tab and see what values do we have here. So here’s our first data layer variable, everything works as expected, and then the visibilityStatus also
is displayed correctly. So the step two is also complete. Now the final step is to send the data to Google Analytics and we’ll do that by using Universal Analytics tag. Go to Tags. Click New and choose Universal Analytics as your tag type, and track type, choose Event, and we’ll need to enter Category, Action and, if we want, Label. At this point we’ll fill
in all three fields. So the category should
be Element Visibility. Actually you can name all
three fields whatever you want, but in this case I’m
gonna name it like that. Action should be Author title is, and then I’m gonna enter our
variable visibilityStatus. And then we have also Label field, let’s put there our elementAttribute, so in this case will be author’s name. If you wish you can also add this: Author name, like this. Now let’s enter Google
Analytics tracking ID. Ideally we should use Google
Analytics settings variable but in this case I’ll just overwrite it with simple tracking ID. Let’s head over to
Google Analytics account, copy this tracking ID, paste it here. What else do we need to add? Tag name, it’s GA Event
– Element Visibility. And we need to choose a data layer trigger that we created a few minutes ago. Let’s test the entire implementation. Refresh the preview and debug console. Now let’s head over to
our website and refresh. Also we need to go to Google Analytics real time event reports and our website. Let’s scroll down till the very end until we see the author title. Yeah, so we see that the
elementVisibility event was fired successfully. Click it, we see that
Google Analytics Event was fired also successfully. And we see that this event was also successfully sent to
Google Analytics server. So Event Category is Element Visibility, Event Action is Author title is shown, and let’s see Author name is Julius. So there you have it. Now you know how to track website elements when they appear on the screen after scrolling up or down. If you have any questions, just post them in the comment section of this video. Thanks for watching! – Alright, thank you,
Julius, for this video. And now you know how you can track elements when they come into the viewport to the browser of the user. Now I find this highly interesting when it comes to advertising
tracking, for example. So if you wanted to find out if your user actually saw an advertising call to action on your page and report on that, then you could do this
with this custom listener. So if you want to install
this, then head down to the blog post that
we have linked up below from Julius on Analytics Mania where he’d written about this and also you can copy the code there. Now if you like this video,
then give us a thumbs-up and also subscribe to this
channel right over there because we bring you new videos, just like this one, every week. Now my name is Julian. See you in the next one!