Code on Redirect URL

Is it possible to add tracking code from DNS settings on the redirect url? Normally this tracking code is needed in the header but my domain is just redirect link.Thanks for helping and here is the Code:

Where’s the code?

1 Like
<script type="text/javascript" src="https://domain.com/integration/general_integration"></script>

and second code

<script type="text/javascript" src="https://domain.com/integration/general_integration"></script>
<script type="text/javascript">
 AffTracker.setWebsiteUrl( "https://targetlink.com" );
 AffTracker.generalClick( "111" );
</script>

More information please.

These are tracking codes for affiliate Network. These codes should send information to the platform. my link is just redirect. I want to track clicks before it redirects from my domain. Can I add TXT record with these codes and track clicks?

No.

There are several ways to do this. Your understanding of JavaScript, the Cloudflare platform, and whether you think black and white are colours or not would dictate the route you would take.

How can i find this solution in the internet? What is this called in proffessional language? I have tried to search but it shows nothing.

Do I need to work in dns settings or some external other setting on cloudflare?

It hasn’t nothing to do with DNS.

How can I find the solution?

You’ll need to write your own (probably JavaScript) code. Do you know how to do that?

No, but I can try it. I have directed NS Settings from domain registrar to cloudflare. I just use cloudflare without any additional hosting. It’s cloudflare’s free plan. I hope it’s possible with it.

Yes.

Try with these.

Thanks mate

No DNS settings. What about Rules? This page is little ununderstandable for me.

which is solution for me from list you sent?

What about rules? Rules aren’t going to allow you to track the clicks before they are redirected.

And if you want to track, what information are you wanting to collect? And where is the information going to get sent?

1 Like

To the affiliate platform.

1 Like

Honestly, I have no idea what you are trying to do.

1 Like

I want these codes to run before the site redirects to the target link. These codes are tracking cookies and usually they must be in the header. Because I have no header because it’s redirect link, I need to run it somehow.

<script type="text/javascript" src="https://domain.com/integration/general_integration"></script>
<script type="text/javascript" src="https://domain.com/integration/general_integration"></script>
<script type="text/javascript">
 AffTracker.setWebsiteUrl( "https://targetlink.com" );
 AffTracker.generalClick( "111" );
</script>