<PAGE>

                                                                    Exhibit 10.4

                     AMENDED AND RESTATED PROMISSORY NOTE


$676,000.00 (U.S.)                                           Seattle, Washington

                                        Original Issuance Date:  October 8, 1999

                                            Amended and Restated:  July 25, 2001


         For value received, the undersigned, Brian McAndrews, promises to
pay on demand to the order of Avenue A, Inc., a Washington corporation (the
"Company"), the principal sum of Six Hundred Seventy Six Thousand Dollars
($676,000.00) with interest compounded annually from the original issuance
date (the "Original Issuance Date") at a rate equal to the greater of (i)
the applicable federal funds rate as determined on the Original Issuance
Date and redetermined each year on the anniversary date of the Original
Issuance Date, or (ii) the lowest rate necessary to avoid the imputation of
interest under the Internal Revenue Code of 1986, as amended, from the
Issuance Date on the unpaid balance until this Amended and Restated
Promissory Note (this "Note"), including the interest thereon, is paid in
full or forgiven in accordance with the terms hereof, such interest to be
paid annually on each anniversary date of this Note.

         If payment of any sum is not made within ten days after demand,
then this Note shall be in default, and, at the option of the holder hereof,
without prior notice, the principal sum and interest shall bear interest
from such default until paid at the rate of twelve percent (12%), compounded
quarterly, or the maximum rate permitted by law, whichever is less.

         Principal and interest are payable in lawful money of the United
States of America at such place as the holder may designate. All payments of
principal and interest hereunder shall be applied first against accrued
interest and then against principal. The undersigned shall have the right,
upon payment of all accrued interest to the date of payment, to pre-pay at
any time in advance of maturity, without premium or penalty, all or any part
of the outstanding principal amount of this Note.

         One-third of the principal balance outstanding on January 1, 2002
and all accrued interest as of such date shall be forgiven on such date if
the undersigned continues to be employed by the Company as of January 1,
2002, one-half of the principal balance outstanding on January 1, 2003 and
all accrued interest as of such date shall be forgiven on such date if the
undersigned continues to be employed by the Company as of January 1, 2003,
and any remaining principal amount and accrued interest shall be forgiven on
January 1, 2004 if the undersigned continues to be employed by the Company
as of January 1, 2004. Promptly after each date on which an amount hereunder
is forgiven in accordance with the preceding sentence, the Company shall
provide to the undersigned, on a "grossed up" basis, an amount equal to the
amount of applicable federal taxes that the undersigned shall owe in respect
of any amounts forgiven on such date (including any taxes on "gross up"
payments).
<PAGE>

Such amounts shall be deposited into an appropriate withholding account on
behalf of the undersigned.

         If the undersigned voluntarily resigns or is terminated for "Cause"
(as that term is defined in Exhibit A hereto ("Cause")), the outstanding
principal amount and accrued interest shall become immediately due and
payable without notice. If (a) the undersigned is terminated without
"Cause," (b) the undersigned is subject to a "Total Disability" (as that
term is defined in Exhibit A hereto), (c) a "Change of Control" (as that
term is defined in Exhibit A hereto) occurs, or (d) the Company winds up its
operations and ceases doing business, then in any such case any outstanding
principal amount plus accrued interest shall be forgiven and the Company
shall promptly thereafter provide to the undersigned, on a "grossed up"
basis, an amount equal to the amount of applicable federal taxes that the
undersigned shall owe in respect of any amounts so forgiven (including any
taxes on "gross up" payments). Such amounts shall be deposited into an
appropriate withholding account on behalf of the undersigned.

         If suit is brought on this Note, or if it is placed in the hands of
an attorney for collection, after any default in any payment, the
undersigned promises and agrees to pay all costs of collection, including
attorneys' fees, incurred thereby. Such costs of collection include, without
limitation, any attorneys' fees and costs incurred by the holder in a
bankruptcy case or proceeding in which the undersigned is a debtor.

         This Note is with full recourse against the undersigned. This Note
is to be construed in all respects and enforced according to the laws of the
State of Washington, without regard for any choice of law rules that might
be asserted to subject this Note to the laws of any other jurisdiction.
Presentment, notice of dishonor and protest are waived by the undersigned.

                                      -2-
<PAGE>

         This Note shall be fully binding on and inure to the benefit of the
successors, heirs, legal representatives and assigns of the parties hereto.
This Note supercedes and replaces in its entirety the promissory note issued
by the Company to the undersigned on October 8, 1999.

ORAL AGREEMENTS OR ORAL COMMITMENTS TO LOAN MONEY, EXTEND CREDIT, OR TO
FORBEAR FROM ENFORCING REPAYMENT OF A DEBT ARE NOT ENFORCEABLE UNDER
WASHINGTON LAW.

                                           Signature:

                                           /s/ Brian McAndrews
                                           ------------------------------------
                                                      Brian McAndrews



Agreed to and accepted this 25th day of July, 2001:

AVENUE A, INC.



/s/ Jeffrey J. Miller
-------------------------
Jeffrey J. Miller
Senior Vice President

                                      -3-
<PAGE>

                                   Exhibit A

     1.   The definition of "Cause" shall include, without limitation, the
occurrence of one or more of the following events:

          (a)  willful misconduct, insubordination, or dishonesty in the
     performance of the undersigned's duties or other knowing and material
     violation of the Company's or a Successor Company's policies and procedures
     in effect from time to time which results in a material adverse effect on
     the Company or a Successor Company (as defined below);

          (b)  willful actions (or intentional failures to act) in bad faith
     with respect to the Company or a Successor Company that materially impair
     the Company's or a Successor Company's business, goodwill or reputation;

          (c)  conviction of a felony involving an act of dishonesty, moral
     turpitude, deceit or fraud, or the commission of acts that could reasonably
     be expected to result in such a conviction;

          (d)  current use by the undersigned of illegal substances; or

          (e)  any material willful violation of a confidentiality agreement
     with the Company.

     "Successor Company" means any of (i) any corporation that acquires all or
substantially all of the assets of the Company in a "Change of Control"
described in clause (d) of the definition of "Change of Control" below or (ii) a
successor corporation to the Company (or parent corporation thereof) resulting
from a "Change in Control" of the Company described in clause (e) of the
definition of "Change of Control" below.

          An "Incumbent Director" is a member of the Company's Board of
     Directors (the "Board") who has been either (i) nominated by a majority of
     the directors of the Company then in office or (ii) appointed by directors
     so nominated, but excluding, for this purpose, any such individual whose
     initial assumption of office occurs as a result of either an actual or
     threatened election contest (as such terms are used in Rule 14a-11 of
     Regulation 14A promulgated under the Securities Exchange Act of 1934, as
     amended (the "Exchange Act")) or other actual or threatened solicitation of
     proxies or consents by or on behalf of a Person other than the Board.

          A "Person" includes any person (including any individual, entity or
     group within the meaning of Section 13(d)(3) or 14(d)(2) of the Exchange
     Act).

     2.   The definition of "Total Disability" means the undersigned's
inability to perform his or her duties at the Company for a period or
periods aggregating ninety (90)
<PAGE>

calendar days in any 12-month period as a result of physical or mental illness,
loss of legal capacity or any other cause beyond the undersigned's control,
unless the undersigned is granted a leave of absence by the Company's Board of
Directors. Total Disability shall be deemed to occur (a) at the end of the
calendar month in which the undersigned's death occurs or (b) provided that an
independent physician appointed by the Company and reasonably acceptable to the
undersigned or his personal representative (the "Independent Physician") has
determined in a written report made available to the undersigned or his personal
representative that the undersigned is unable to perform his or her duties at
the Company as a result of physical or mental illness, loss of legal capacity or
any other cause beyond the undersigned's control, and such disability has been
in effect for a period or periods aggregating ninety (90) calendar days in a 12-
month period, immediately upon notice to the undersigned or his or her personal
representative. Notwithstanding the foregoing, Total Disability shall not
include any temporary illness or condition that prevents the undersigned from
performing his or her duties for a period of no more than 180 days if, in the
opinion of the Independent Physician, the undersigned is reasonably likely to
recover within 180 days or less from the onset of the illness or condition, such
that he or she can permanently resume performance of his or her duties.

     3.   The definition of "Change of Control" means any of the following:

          (a)  an event in which any person (including any individual, entity or
     group within the meaning of Section 13(d)(3) or 14(d)(2) of the Securities
     Exchange Act of 1934, as amended, (the "Exchange Act")) (a "Person"), shall
     become the beneficial owner (within the meaning of Rule 13d-3 promulgated
     under the Exchange Act), directly or indirectly, of fifty percent (50%) or
     more of the combined voting power of the capital stock of the Company then
     outstanding; or

          (b)  at any time during which the Company has a class of equity
     securities which is listed on a national securities exchange or an
     automated quotation system (including, without limitation, the Nasdaq Stock
     Market) ("publicly traded"), a Person acquires equity securities
     representing more than thirty percent (30%) of the combined voting power of
     the capital stock of the Company outstanding as of the date of such
     transaction (or the first of a series of related transactions), but only if
     such equity securities were acquired in a transaction or series of related
     transactions which were not approved by the Board of Directors of the
     Company in office prior to the date of such first acquisition (provided,
     however that if such Person is entitled, pursuant to Rule 13d-1 under the
     Exchange Act to file a Form 13G with respect to its holdings of equity
     securities of the Company in lieu of a Form 13D, such event will not
     constitute a Change of Control unless and until such Person files a Form
     13D with respect to such holdings); or

          (c)  at any time during which the Company has a class of equity
     securities which is publicly traded, a Person acquires equity securities
     representing more than twenty percent (20%) of the combined voting power of
     the capital stock of the

                                      -2-
<PAGE>

     Company outstanding prior to the date of such transaction (or the first of
     a series of related transactions) in a transaction or series of related
     transactions which were not approved by the Company's Board of Directors in
     office prior to the date of such first acquisition, and, within one year
     thereafter, at least two individuals whose election to the Board of
     Directors was proposed by such person are members of the Board of
     Directors; or

          (d)  the sale or other disposition of all or substantially all of the
     Company's assets, other than to a corporation with respect to which
     immediately following such sale or disposition (i) securities representing
     more than sixty percent (60%) of the combined voting power the capital
     stock of such corporation are then beneficially owned, directly or
     indirectly, by all or substantially all of the beneficial owners of
     securities representing the combined voting power of the capital stock of
     the Company (the "Company Voting Securities") immediately prior to such
     sale or disposition in substantially the same proportion as their
     ownership, immediately prior to such sale or other disposition, of Company
     Voting Securities, (ii) no Person (excluding the Company, any employee
     benefit plan (or related trust) of the Company or such corporation and any
     Person beneficially owning, immediately prior to such sale or other
     disposition, directly or indirectly, securities representing 33% or more of
     Company Voting Securities) beneficially owns, directly or indirectly,
     securities representing 33% or more of the combined voting power of the
     capital stock of such corporation; and (iii) at least a majority of the
     members of the board of directors of the such corporation were approved by
     majority of directors of the Incumbent Directors on the Company's Board of
     Directors at the time such transaction was initially approved by the
     Company. An "Incumbent Director" is a director (A) nominated or appointed
     by a majority of the Company's current Board of Directors or (B) nominated
     or appointed by directors nominated or appointed by a majority of the
     Company's current Board of Directors; or

          (e)  the reorganization, merger or consolidation of the Company with
     any other corporation or entity, in each case unless immediately following
     such reorganization, merger or consolidation (i) securities representing
     more than 60% of the combined voting power of the capital stock of the
     corporation resulting from such reorganization, merger or consolidation are
     then beneficially owned, directly, or indirectly, by all or substantially
     all of the individuals and entities who were the beneficial owners of
     Company Voting Securities immediately prior such reorganization, merger or
     consolidation in substantially the same proportion as their ownership
     immediately prior to such reorganization, merger or consolidation, of
     Company Voting Securities, (ii) no Person (excluding the Company, any
     employee benefit plan (or related trust) of the Company or such corporation
     resulting from such reorganization, merger or consolidation and any Person
     beneficially owning, immediately prior to such reorganization, merger or
     consolidation, directly or indirectly, securities representing 33% or more
     of Company Voting Securities) beneficially owns, directly or indirectly,
     securities representing 33% or more of the

                                      -3-
<PAGE>

     combined voting power of the corporation resulting from such
     reorganization, merger or consolidation, and (iii) at least a majority of
     the members of the board of directors of the corporation resulting from
     such reorganization, merger or consolidation were the Incumbent Directors
     at the time that the agreement for such reorganization, merger or
     consolidation was initially executed; or

          (f)  the dissolution or liquidation of the Company; or

          (g)  a change in the composition of the Company's Board of Directors
     in which the majority of the seats (other than vacant seats) on the Board
     have been occupied by individuals who were neither (i) nominated or
     appointed by a majority of the current Board of Directors nor (ii)
     nominated or appointed by directors nominated or appointed by a majority of
     the current Board of Directors.

                                      -4-