1

I am doing a PHP tool to track my email campaigns (only for my customers, not for spamming).

The logic is the following:

  1. Number of sent emails.
  2. Number of people who open the email.
  3. Number of people who clicks on the link inside the email.
  4. Final conversion number.

The thing is: I know how to count the sent and opened emails. But not how to track the number of customers that click the link inside the email and if that customer do conversion or not. Any idea?

Btw: I can share the repo to develop the tool together if you're interested :)

Thank you folks!

alexhoma
  • 342
  • 1
  • 7
  • 19

3 Answers3

3

Tracking opening the email:

In the email have a 1px x 1px image, the source of which is something like:

<img alt="something" src="http://yourdomain.com/track/open/{{RECIPIENTID}}" />

It can return a 1px 1px transparent square or something, but on that .php page you can take the recipient, or email ID and flag it as opened in your database.

Tracking the link click:

If you have a link in the email that goes to say:

www.google.com 

Change this (programatically) to something like:

http://yourdomain.com/track/link/{{RECIPIENTID}}/{{ORIGINALLINK}} 

That page will take the recipient ID and flag it as having clicked on the given link, you can then redirect the user to the original link.

JohnnyFaldo
  • 4,121
  • 4
  • 19
  • 29
2

Typically, with emails like these, the visual link is quite short "Read more" for example. The actual link itself will be stuffed with GET parameters such as "?campaign=ABCDEF123&emailtype=control&segmentid=23". You would make use of $_GET to pull out these values and store those in whatever medium you prefer. The same principle applies for your conversions by embedding values into the form submission ($_POST) or link clicking ($_GET).

John Purtle
  • 101
  • 1
  • 6
1

yeah its simple man follow my step

step 1 :while mail sent you just add the your own page link like this

<a href="http://example.com/own_page.php?id=<?php echo any unique user id ?>&original_link=<?php echo facebook.com ?>" >click here</a>

step 2: when user click the link your page navigate so there you do update using user unique id and then redirect him to original link that's all.

JYoThI
  • 11,977
  • 1
  • 11
  • 26