Announcement

Collapse
No announcement yet.

Can I have a log of how often my registered customers visit my site?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can I have a log of how often my registered customers visit my site?

    The following will create a file called 'customer_account.log' in the 'acatalog' folder on your server:

    * open 'Windows Explorer' and browse to your site folder

    * locate 'ACTINIC.pm' and take a backup

    * open the file in a text editor such as notepad and search for:

    CAccLogin - User login

    * you should see:

    #######################################################
    # CAccLogin - User login
    # No arguments

    * directly before this copy and paste the following code:

    sub AccountLogFile
    {
    my ($pBuyer) = shift;
    my $sFilename = GetPath() . "customer_account.log";
    my $bDoHeader = !-e $sFilename;
    #
    # The log file is a comma separated file which contain the following
    # items:
    #
    # 0 - date/time
    # 1 - browser name or IP address
    # 3 - customer ID
    # 4 - buyer ID
    # 5 - buyer name
    #
    open (LOGFILE, ">>" . $sFilename);
    #
    # If the file doesn't exist then create its header
    #
    if ($bDoHeader)
    {
    print LOGFILE "Version: $::EC_MAJOR_VERSION\nDate, Remote host, Customer ID, Buyer ID, Buyer Name\n";
    }
    print LOGFILE ACTINIC::GetActinicDate();
    print LOGFILE ", ";
    print LOGFILE (length $::ENV{REMOTE_HOST} > 0 ? $::ENV{REMOTE_HOST} : $::ENV{REMOTE_ADDR});
    print LOGFILE ", ";
    print LOGFILE $$pBuyer{AccountID};
    print LOGFILE ", ";
    print LOGFILE $$pBuyer{ID};
    print LOGFILE ", ";
    print LOGFILE $$pBuyer{Name};
    print LOGFILE "\n";
    close LOGFILE;
    }

    * then search for:

    $::Session->SetDigest($sDigest);

    * you should see:

    if($bLoggingIn)
    {
    ($Status, $sMessage) = CaccSetCheckoutFields($pBuyer, $pAccount);
    if($Status != $::SUCCESS)
    {
    ACTINIC::ReportError($sMessage, ACTINIC::GetPath());
    }
    $::Session->SetDigest($sDigest);

    * paste the following directly after the above:

    ACTINIC::AccountLogFile($pBuyer); # Log file for the customer account.

    * close and save the file and upload your site
Working...
X