Forums

Referrer link in e-mail

mskarka 03 Feb, 2016
Hi,
I'm trying to figure out how to put referrer link inside of report mail that I always receive. It would be great, because I would be able to track our PPC adds activities.

I found this topic: http://www.chronoengine.com/forums/posts/f5/t14756.html

But I'm not good in PHP. Can this be done in V5? If yes, how?

Thank you
GreyHead 03 Feb, 2016
Answer
Hi msarka,

You can capture the referer link using a Custom Code action in the form ON Load event
<?php
$form->data['referer'] = $_SERVER['HTTP_REFERER'];
?>
Then add a hidden input with the name 'referer' to add this to the submitted form data.

Bob
mskarka 03 Feb, 2016
Hi Bob,
thx for your help. But I'm probably doing something wrong. Because the fild in e-mail is still blank.

So these were my steps:
1) At Designer > Layout - I added hidden Text Box
a) Filed Name: referer
b) Field ID: referer
c) Label: Referer
d) Load state: Hidden
2) Setup > At On Load - I added Custom Code, at the end
a) Before this custom code there are: Load Honeypot, Load Google Noaptcha, JS Client Validation, HTML Render form, Load CSS... Custom Code (referer)
b) Action Laber of this custom code: Refrer
c) Content: Your code
3) In my e-mail template I added this (to other columns): <tr><td>Referer</td><td>{referer}</td></tr>
...
But the result is blank at my testing๐Ÿ˜Ÿ

Any help?

Thank you.
GreyHead 03 Feb, 2016
Hi mskarka,

Please drag the Custom Code action up before the HTML (render form) action so that the data is there when the form is built.

If that isn't the solution please drag a Debugger action into the On Load event at then end then copy and paste the debug results here.

Bob
mskarka 03 Feb, 2016
Hi Bob! It works! Thank you very much!๐Ÿ™‚
mskarka 03 Feb, 2016
Hi Bob! It works! Thank you very much!๐Ÿ™‚
This topic is locked and no more replies can be posted.