There are some data points that you will want to be sent into Adobe Analytics on every page. This video shows how to set up a global page load rule in which to send those data points.
Hey everybody, this is Doug. In this video I want to talk to you about creating a default page load rule. Now, you can go in and actually set some global variables in the analytics extension configuration, however, you’ll have much more control if you actually create a rule that handles all of the default stuff that should happen on every page. And so, that’s our recommendation, best practice here, and I’m going to go into rules, we don’t have any rules yet, I’m going to create a new rule.
And so, we’re going to call this Default Page Load Rule. Now, we can change the name of that and I might in just a minute, I’m going to show ya a few things on creating this. Now, when you’re creating rules, and hopefully you’ve had a chance to kind of learn a little bit about launch and you know about rules, but we’re going to run through this anyway. Now, the event that we’re going to add, when do we run this rule, click on add. And we are going to go to the event type all the way down to the bottom, and we’re going to go to DOM ready. So this is basically at the bottom of the page, and this is the event that is deemed the best practice for loading analytics at the bottom of the page. Now, the other thing I want to show you here is this order. Now what the order does is exactly what you probably think, is which order do I run these different rules in? What if I have two rules that are on event type DOM ready, which one runs first and which one run second? So, we have this order here, and by default, everything is set to 50, so, we just need to set it to a higher number if we want it to run last, it’ll start down at one and it’ll move its way up. So, what I’m going to show you here is that on this, I suggest setting it to something above 50. So, right now, I’m just going to pick 60, I could’ve picked 51, whatever, I’m just going to suggest that you run this after 50. Because this way, we’re going to have a beacon sent in on this rule, and we’re going to want to set other things before we run this rule and send the beacon. Okay, so I’m going to leave that right now and say ‘keep changes’. Now, we’re going to go down, and I don’t need a condition because I want this to run on every page. So I’m going to leave that blank. I’m going to go down to actions, and we’re going to click add. And for the extension, we’re going to choose Adobe Analytics and the action is to set variables. Now, this is a great time to refer back to our SDR, to our blueprint, so, let’s take a look at that. And we have a number of these things that are going to be set, well really just a few, on the default page load rule. So, when we go up to the events, we’re going to see that event one is our page view event, and we want that to be set on every page. So, we’re going to go ahead and set event one on our default page load rule. Okay, so we scroll down a little bit, set event one.
Great, very easy. Now, we’re going to set the page name, and we’re going to set the page both into eVar1 and also into the page name variable here. So, both are going to be set, of course, in this default page load rule and so, they’re going to be pulled right out of that data element that we created called page name, same thing. So, we can just run back here and we can go up to our eVar, and, did we say eVar1, eVar1, so, we’re going to set eVar1 and we’re going to set it as, and we click on this icon, and it’ll give us our data elements and we choose page name, select. Okay, now we also need our page name variable, right there, so we’re going to set that to the page name as well. Boom. Great, all done with that. We jump back, and the other one we’re going to set is a site section, default page load rule, site section, default page load rule. So, we’re going to set the site section in eVar2 and in the channel, so we go back and we say, we’re going to set eVar2, which is up here. Add another, eVar2 and set that as the site section. Select.
We go down, and we have the channel right there, and we are just going to set that to the site section as well, and now that’s done. So if we look back here, we’ve done both of these, we’ve done both of those, and we’ve set our page view event, and that’s all we had for our default page rule. We have some other page rules, some other rules that are going to be on page load, so for example, you can see this search page rule we’re only going to run this rule when there’s an actual search. So, we’re not going to run it on every page, and we could, potentially if we were only setting the query string parameter, 'cause we could say, look on every page and see if it’s set, but at the same time, since we’re going to set a search event, we only want to set it when there’s a search. So, we’re not going to set that one on a default page load. So, that’s pretty much it for this one. Again, if you have other things, you probably will, in fact, you might have other things that you’re going to set into a number of other eVars, so you might have other ones to set here. In any case, this will run on every page, and send that data into our analytics. So, I’m going to hit keep changes. Now, I did say it was going to send it in, it’s not going to send it in yet. That only sets the variables, we’re going to add one more action down here. And we’re going to choose, again, our analytics extension, and this time we need to send a beacon, and this is where we decide, are we going to send a page view beacon? Or are we going to send what we call a custom link or an s.tl, which is not a page view. In this case, it is a page view, so we want s.t to run, and so that’s great and we can just keep changes.
And now, on every page at the bottom, DOM ready, it will set those variables and it will send in the beacon, and that is our default page rule. And so, we could if we wanted to, for example, set this to, like, DOM ready 60, and that will give us some more information in the list to help us understand when it’s going to run. So I’m going to go ahead and set it like that and we will save that to our library and build it.
And this is done, so now we’re going to be able to go in and see this hit happen, and we’ll do that on the next video.