- Joined
- May 7, 2018
- Messages
- 4,563
In this guide, I’m going to show you how you can centralize your landing page scripts so that when you need to make changes you can do it in 1 place instead of on every single landing page you have separately.
This isn’t something that’s required if you’re using landing pages, but if definitely makes your life 200% easier. I’ve also had a few people ask me about how to do this, so I thought it would be good to make it as a guide for others.
Let’s get started.
For this example, let's say it looks something like this:
This isn’t something that’s required if you’re using landing pages, but if definitely makes your life 200% easier. I’ve also had a few people ask me about how to do this, so I thought it would be good to make it as a guide for others.
Let’s get started.
Make a Javascript File with All Your Scripts
The first thing you’re going to want to do is make a Javascript file with all of the landing page scripts you typically use. This might be the back button script, a push script, and whatever else you like to use on your landing page to get those juicy conversions.For this example, let's say it looks something like this:
JavaScript:
// Get URL Params
function getURLParameter(name) {
return decodeURIComponent((RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, null])[1] || '');
}
// Propush
if (!getURLParameter('push')) {
var s = document.createElement('script');
s.src = '//oungimuk.net/act/files/micro.tag.min.js?z=1234567' + '&sw=/sw-check-permissions-c123e.js';
s.onload = function (result) {
switch (result) {
case 'onPermissionDefault':