I really love Active4D. I'm always impressed when I can whip something
together in minutes.

After being bugged to add email delivery tracking, I finally gave in this
morning. Even though I'd never done it before, I had it running with
Active4D in less than an hour.

I sent an email blast a couple hours later to 4,000 clients and within 2
hours I knew that 400 of them had viewed the email.

In case it would be useful for someone, here's how I did it.

The tracking HTML in the email looks like this (extra line breaks inserted):

<img src='http://mysite.com/image.a4d?
b=111&r=222&i=333&t=444'
alt='' width='1' height='1' border='0'>

The arguments are:

b - The number of the email blast
r - A random number to prevent caching (probably not needed)
i - Contact record ID
t - Time the contact record was created

The ID and time are used together to ensure that the request is valid.

The following was used to generate the above img request for each contact in
the email blast. (I use Active4D for mail merge.):

<img src='http://mysite.com/image.a4d?
b=111&
r=<%=random between(10000;99999)%>&
i=<%=[Contact]ID%>&
t=<%=[Contact]Time_Created*1%>'
alt='' width='1' height='1' border='0'>

Here's the code for image.a4d (largely lifted from the image.a4d file
included with Active4D.):

<%

c_picture ($pict)
c_longint ($id; $time; $blast)

$params := a4d.web.getVariablesIterator

if ((collection has($params; "i"))
     & (collection has($params; "t")))
    $id := num($params{"i"})
    $time := num($params{"t"})
    $blast := num($params{"b"})

    query ([Contact]; [Contact]ID = $id; *)
    query ([Contact]; &; [Contact]Time_Created = $time)
    
    if (records in selection ([Contact]) = 1)
        // Do the logging here
    end if
    
end if

get picture from library(909; $pict)
write gif($pict;1;1)

%>

Picture 909 was created in the 4D Picture Library as a single white pixel.

Thanks Aparajita for such a great tool!

Will Mayall



_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to