First of all, we fill the site with content: add all the necessary pictures and inscriptions. After everything is ready, enable developer mode. To do this, click the button as in the screenshot below:

A code editor appears at the bottom, go to it:

Select ALL the code that is there and insert ours instead:
import wixLocation from 'wix-location';
$w.onReady(function () {
function getParametersAsString(url) {
return url.substring(url.indexOf("?"), url.length)
}
//Start image click handler
$w('#image1').onClick((event) => {
wixLocation.to("https://google.com" + getParametersAsString(wixLocation.url));
});
//End handler
});
Check carefully that you copied everything correctly! Especially if you are on a MAC! Make sure the quotes look like quotes and not quot!!!
Now let’s look at the name of our image, which we inserted onto the page and which users will click on. To do this, click on the image and see that his name appears in the upper corner. In this case, image3.

You will most likely have an imageimage1, if this is not so, then correct the line in the codeimage1 to your image title.
If you don’t have an image, but a button, then change image1 to button1 or whatever it’s called. If you have several buttons or images, then copy the code between the lines “Handler start — handler end” and paste them the required number of times (according to the number of buttons and/or images). Write your button/image identifier in each of the inserted pieces of code.
The last step is to change in the codehttps://google.comto your campaign link in Keitaro WITHOUT a long tail of tags.
Publish our site in Wix with the buttonPublish.

Vicks gives us a link to the site. Let’s copy it!

We paste the link into the browser and add any sub-tags to it at the end. For example:https://rattack5.wixsite.com/mysite?sub1=abc&sub2=345
And press Enter. Our website opens. Clicking on the image should now take us to the campaigntracker: http://example.com?sub1=abc&sub2=345
Bonus: adding an auto-redirect with cloaking
We can determine by UserAgent who came to us. If this is a Facebook bot, we leave it on our page, but if it is a regular user, then we can automatically redirect it to offer. In the example below, the auto redirect occurs after 300 ms.
import wixLocation from 'wix-location';
function getParametersAsString(url) {
return url.substring(url.indexOf("?")+1, url.length);
}
function isFacebookBot() {
var userAgent = navigator.userAgent.toLowerCase();
return userAgent.includes('facebook') || userAgent.includes('facebot');
}
let dest = "https://example.com?" + getParametersAsString(wixLocation.url);
if (!isFacebookBot()) setTimeout(() => { wixLocation.to(dest); }, 300);
$w.onReady(function () {
$w("#image1").onClick((event) => {
wixLocation.to(dest);
});
//End handler
});


