Hello, arbitrageurs! How's it going in there? Is the traffic flowing? And here Yellow not a bread, let something prooptimizirovat. Today we'll take apart a handy thing - a "Thank you" page for any topic and (almost) any GEO.
Personally, I am very tired of messing around with PP's Thank You pages: sometimes they are not in Geo, but in plain English or Russian and need to be translated, then a pixel needs to be added to each of them, then the design is super ugly, etc. And on this occasion, I decided to create a universal version, to once and for all forget about the fact that such a thing as a page "Thank you" exist in general.
The full solution code is on GitHubI'll let you know what's what.
Features list
First, let's walk through the feature set:
- Support for various design templates
- Automatic translation of page text
- Inserting a Facebook Pixel
- Selecting a pixel event
- Caching of translated pages, so you don't have to jerk the translator
Now let's go step by step and figure out how to work with it.
Working with templates
A template is essentially a folder that holds 2 files:
- html file t.html - Here is the page design
- text file text.txt - here is the whole text
How do I create a template? Easy: create a subfolder with the name you want in the folder templates, throw in the html file of the Thank You page from PP or your own and rename it to t.hml.
Note: If your Thank You CSS styles are in a separate file, copy and paste them INTO t.hml. To do this, create a tag <style></style>
shortly after <body>
and shove what you have copied in there.
Now you need to create a file in the same folder text.txt. What to write there? Open your Thank You HTML in any text editor (I prefer Notepad++) and look for all the text chunks in it: sentences or individual words. In short, anything that will change depending on the GEO.
You copy each piece of text you find onto the NEW line of the text.txt file. And instead of the copied text in the HTML file you write this construction: {T1}
- for the first piece, {T2}
- for the second, etc. If the chunks are the same, the substitution will be the same (see at {T1}
in the screenshot below).
Yes, the text language of ALL your templates MUST be the same in order for auto-translation to work correctly. The default is English, but you can change it to, say, Russian by changing en to ru in the file template.php
With the creation of templates solved, let's move on to work with autotranslation.
Autotranslate page
Automatic translation of the Thank you page is carried out with the help of three services: Google Translate, Deepl or LibreTranslate. If you use Deepl, open the translators/deepl.php file and add your API key there. Both paid and free APIs are supported.
The set of languages supported by each translator can be found inside the translator file. Google Translate works through a hack - i.e. not through the official api, so it doesn't ask for money) By default (if the target language is supported) Google is used, then Deepl, and at the very end LibreTranslate. You can change this order by editing the translator.php file.
All translation services use a two-letter language designation, A complete list of two-letter acronyms can be found here.
Note: If you suddenly choose an unsupported language, Universal Thank You will show the page in English.
By default, Universal Thank You has caching enabled: why pull the translator service for each user from the same GEO? It's easier to get the translation once and then use the saved version. For this purpose, my Thank You creates a folder cachewhere, depending on the template and language, saves the desired html page with translation.
Connecting the Universal Thank You page
The first thing you should do is to create a hosting folder and download all the code from github + your templates, if you have time to make them yourself. Personally in your Keitaro I took the standard folder where Keitaro uploads all the procool-lands and that's where I made the thankyou folder.
Here we go, let's look at the two standard ways of connecting:
- redirect
- Including the code page via include
As you might understand, the Thank You page is usually called from a PHP script to send leads, such as order.php. And one of the most common options for connecting a thank you page is a redirect.
It looks like a call to the header function in the code of the lead sending file:
As a parameter of this function, first there is a Location string followed by the address of the file to which we are redirecting, and then the parameters are added to it.
How do I write the redirect address? If you have the lead sending file in the same folder as your lead index file, then it turns out that the index.php file of our Universal Thank You is one level up in the thankyou folder:
.../thankyou/index.php
Next, we look at what parameters we have:
- px - is responsible for passing the pixel identifier to Facebook
- pixelevent - pixel event (Lead by default)
- lang - the language in which Thanks should be displayed (the default is en)
- template - template (by folder name, e.g. shakes. By default, if the parameter is not specified, a random template is selected)
All options except for the pixel can not be written, the default values will be used.
The result is about this kind of construction:
An example to set up a redirect is in the file exampleredirect.php
What if we don't want to do a redirect, but want to use include?
Then it goes something like this:
How to make settings for this kind of connection should be clear from the screenshot, I will only draw your attention to the fact that when you connect via include, you can change the name of the label, in which you have the script to send leads pixel Facebook.
An example for setting via include can be found in the file exampleinclude.php
That's actually all the possibilities, that's enough for me for now!
I think I'll add this universal Thank You to my freebie cloI wish you to pour in plus and write me feedback in PM and comments!
Your projects are excellent! I recently met your cloaker and I’m delighted! I hope you continue to evolve with this project! Sorry for my English.
Thanks for your kind words. Yep, the cloaker is evolving right now, new version is coming soon this year.