Skip to main content
All CollectionsGuides
Obtaining a clickid for passing it in site codes
Obtaining a clickid for passing it in site codes
Push House avatar
Written by Push House
Updated over 2 years ago

If you've placed our code on a landing page and want to set up a postback upon subscription, this guide is for you.

Let's assume your landing page is located at https://site.com/landing/.

You redirect traffic to it by passing the clickid from your tracker, affiliate network, or another source in the following format:

When a user is redirected from your source, the {clickid} macro is replaced with the actual clickid, resulting in a link like this:

Now, we need to pass the current value of the "clickid" GET parameter, which is currently abc123, to the installed code.

In the Partners.House dashboard, go to the "Streams" section, find the relevant platform, and click "Get Code".

In the modal window, you'll see code in this format:

<script type="text/javascript">
use strict;
const time_wait= 0;
const blackout=0;
const yaban = 0;
const title = "";
const desc = "";
</script>
<script type="text/javascript" src="https://news-capufu.com/code/https-v2.js?uid=YYYYY&site=XXXXX&banadu=0&sub1=sub1&sub2=sub2&sub3=sub3&sub4=sub4" async></script>
<script type="text/javascript" src="https://news-bawoza.com/process.js?id=XXXXX&p1=sub1&p2=sub2&p3=sub3&p4=sub4" async></script>

Mind that in this code YYYYY is your user ID, and XXXXX is your platform ID.

Now we need to edit the code to make it read and pass the parameter from the link to the landing page.

1. Remove

"use strict;"

from the code to avoid potential conflicts.

2. Remove the first included script (the penultimate line)

<script type="text/javascript" src="https://news-capufu.com/code/https-v2.js?uid=YYYYY&site=XXXXX&banadu=0&sub1=sub1&sub2=sub2&sub3=sub3&sub4=sub4" async></script>

We will generate it along the way.

3. Now add new code after "const desc = "";" and before "</script>":

const urlParams = newURLSearchParams(window.location.search);
const clickid = urlParams.get('clickid');
const script = document.createElement('script');
script.src = "https://news-capufu.com/code/https-v2.js?uid=YYYYY&site=XXXXX&banadu=0&sub1="+clickid;
script.async = true;
document.body.appendChild(script);

4. In the added code, replace YYYYY and XXXXX with your IDs from the initial code.

5. In the line "const clickid = urlParams.get('clickid');", data is taken from the link to your landing page. If your parameter in the link differs from "clickid", specify it where the parentheses are. Example:

const clickid = urlParams.get('my_url_parameter');

As a result, you should have the following code:

<script type="text/javascript">
const time_wait= 0;
const blackout=0;
const yaban = 0;
const title = "";
const desc = "";

const urlParams = new URLSearchParams(window.location.search);
const clickid = urlParams.get('clickid');
const script = document.createElement('script');
script.src = "https://news-capufu.com/code/https-v2.js?uid=YYYYY&site=XXXXX&banadu=0&sub1="+clickid;
script.async = true;
document.body.appendChild(script);
</script>
<script type="text/javascript" src="https://news-bawoza.com/process.js?id=XXXXX&p1=sub1&p2=sub2&p3=sub3&p4=sub4" async></script>

Place the obtained script at the bottom of the page above the "</html>" tag.

Did this answer your question?