<PAGE>

                                                                     Exhibit 3.1

     FOURTH AMENDED AND RESTATED CERTIFICATE OF INCORPORATION OF
                          BLUE MARTINI SOFTWARE, INC.

     MONTE ZWEBEN and JOHN CALONICO hereby certify that:

     ONE:   The original name of this corporation is Blue Martini Software, Inc.
            and the date of filing the original Certificate of Incorporation of
            this corporation with the Secretary of State of the State of
            Delaware is January 12, 1999.

     TWO:   They are the duly elected and acting President and Secretary,
            respectively, of Blue Martini Software, Inc., a Delaware
            corporation.

     THREE: The Certificate of Incorporation of this corporation is hereby
            amended and restated to read as follows:

                                      I.


     The name of the corporation is Blue Martini Software, Inc. (the
"Corporation" or the "Company").

                                      II.


     The address of the registered office of the Corporation in the State of
Delaware is:

               Corporation Service Company
               1013 Centre Road
               Wilmington, DE  19805
               County of New Castle

     The name of the Corporation's registered agent at said address is
Corporation Service Company.

                                     III.

     The purpose of the Corporation is to engage in any lawful act or activity
for which a corporation may be organized under the General Corporation Law of
the State of Delaware.

                                      IV.


     A. This Corporation is authorized to issue two classes of stock to be
designated, respectively, "Common Stock" and "Preferred Stock." The total number
of shares which the Corporation is authorized to issue is Five Hundred Five
Million (505,000,000) shares, Five Hundred Million (500,000,000) shares of which
shall be Common Stock (the "Common Stock") and Five Million (5,000,000) shares
of which shall be Preferred Stock (the "Preferred Stock").

                                      1.
<PAGE>

The Preferred Stock shall have a par value of one-tenth of one cent ($0.001) per
share and the Common Stock shall have a par value of one-tenth of one cent
($0.001) per share.

     B. The Preferred Stock may be issued from time to time in one or more
series. The Board of Directors is hereby authorized, by filing a certificate (a
"Preferred Stock Designation") pursuant to the Delaware General Corporation Law
("DGCL"), to fix or alter from time to time the designation, powers, preferences
and rights of the shares of each such series and the qualifications,
limitations, or restrictions of any wholly unissued series of Preferred Stock,
and to establish from time to time the number of shares of any series subsequent
to the issuance of shares of that series, but not below the number of shares of
such series then outstanding. In case the number of shares of any series shall
be decreased in accordance with the foregoing sentence, the shares constituting
such decrease shall resume the status that they had prior to the adoption of the
resolution originally fixing the number of shares of such series.

                                      V.


     For the management of the business and for the conduct of the affairs of
the corporation, and in further definition, limitation and regulation of the
powers of the corporation, of its directors and of its stockholders or any class
thereof, as the case may be, it is further provided that:

     A. Management

          1.   The management of the business and the conduct of the affairs of
the corporation shall be vested in its Board of Directors. The number of
directors that shall constitute the whole Board of Directors shall be fixed
exclusively by one or more resolutions adopted by the Board of Directors.

          2.   Board of Directors

               a.   Subject to the rights of the holders of any series of
Preferred Stock to elect additional directors under specified circumstances,
following the closing of the initial public offering pursuant to an effective
registration statement under the Securities Act of 1933, as amended (the "1933
Act"), covering the offer and sale of Common Stock to the public (the "Initial
Public Offering"), the directors shall be divided into three classes designated
as Class I, Class II and Class III, respectively. Directors shall be assigned to
each class in accordance with a resolution or resolutions adopted by the Board
of Directors. At the first annual meeting of stockholders following the closing
of the Initial Public Offering, the term of office of the Class I directors
shall expire and Class I directors shall be elected for a full term of three
years. At the second annual meeting of stockholders following the Initial Public
Offering, the term of office of the Class II directors shall expire and Class II
directors shall be elected for a full term of three years. At the third annual
meeting of stockholders following the Initial Public Offering, the term of
office of the Class III directors shall expire and Class III directors shall be
elected for a full term of three years. At each succeeding annual meeting of
stockholders, directors shall be elected for a full term of three years to
succeed the directors of the class whose terms expire at such annual meeting.
During such time or times that the corporation is subject to Section

                                      2.
<PAGE>

2115(b) of the California General Corporation Law ("CGCL"), this Section A.2.a
of this Article V shall not be effective and Section A.2.b of this Article shall
apply.

               b.   In the event that the corporation is subject to Section
2115(b) of the CGCL, Section A.2.a of this Article V shall not apply and all
directors shall be shall be elected at each annual meeting of stockholders to
hold office until the next annual meeting.

               c.   No person entitled to vote at an election for directors may
cumulate votes to which such person is entitled, unless, at the time of such
election, the corporation (i) is subject to Section 2115(b) of the CGCL and (ii)
is not a "listed" corporation or ceases to be a "listed" corporation under
Section 301.5 of the CGCL. During this time, every stockholder entitled to vote
at an election for directors may cumulate such stockholder's votes and give one
candidate a number of votes equal to the number of directors to be elected
multiplied by the number of votes to which such stockholder's shares are
otherwise entitled, or distribute the stockholder's votes on the same principle
among as many candidates as such stockholder thinks fit. No stockholder,
however, shall be entitled to so cumulate such stockholder's votes unless (i)
the names of such candidate or candidates have been placed in nomination prior
to the voting and (ii) the stockholder has given notice at the meeting, prior to
the voting, of such stockholder's intention to cumulate such stockholder's
votes. If any stockholder has given proper notice to cumulate votes, all
stockholders may cumulate their votes for any candidates who have been properly
placed in nomination. Under cumulative voting, the candidates receiving the
highest number of votes, up to the number of directors to be elected, are
elected.

Notwithstanding the foregoing provisions of this section, each director shall
serve until his successor is duly elected and qualified or until his death,
resignation or removal.  No decrease in the number of directors constituting the
Board of Directors shall shorten the term of any incumbent director.

          3.   Removal of Directors

               a.   During such time or times that the corporation is subject to
Section 2115(b) of the CGCL, the Board of Directors or any individual director
may be removed from office at any time without cause by the affirmative vote of
the holders of at least a majority of the outstanding shares entitled to vote on
such removal; provided, however, that unless the entire Board is removed, no
individual director may be removed when the votes cast against such director's
removal, or not consenting in writing to such removal, would be sufficient to
elect that director if voted cumulatively at an election which the same total
number of votes were cast (or, if such action is taken by written consent, all
shares entitled to vote were voted) and the entire number of directors
authorized at the time of such director's most recent election were then being
elected.

               b.   At any time or times that the corporation is not subject to
Section 2115(b) of the CGCL and subject to any limitations imposed by law,
Section A.3.a. above shall no longer apply and removal shall be as provided in
Section 141(k) of the DGCL.

          4.   Vacancies

                                      3.
<PAGE>

               a.   Subject to the rights of the holders of any series of
Preferred Stock, any vacancies on the Board of Directors resulting from death,
resignation, disqualification, removal or other causes and any newly created
directorships resulting from any increase in the number of directors, shall,
unless the Board of Directors determines by resolution that any such vacancies
or newly created directorships shall be filled by the stockholders, except as
otherwise provided by law, be filled only by the affirmative vote of a majority
of the directors then in office, even though less than a quorum of the Board of
Directors, and not by the stockholders. Any director elected in accordance with
the preceding sentence shall hold office for the remainder of the full term of
the director for which the vacancy was created or occurred and until such
director's successor shall have been elected and qualified.

               b.   If at the time of filling any vacancy or any newly created
directorship, the directors then in office shall constitute less than a majority
of the whole board (as constituted immediately prior to any such increase), the
Delaware Court of Chancery may, upon application of any stockholder or
stockholders holding at least ten percent (10%) of the total number of the
shares at the time outstanding having the right to vote for such directors,
summarily order an election to be held to fill any such vacancies or newly
created directorships, or to replace the directors chosen by the directors then
in offices as aforesaid, which election shall be governed by Section 211 of the
DGCL.

               c.   At any time or times that the corporation is subject to
Section 2115(b) of the CGCL, if, after the filling of any vacancy by the
directors then in office who have been elected by stockholders shall constitute
less than a majority of the directors then in office, then

                         (i)  Any holder or holders of an aggregate of five
percent (5%) or more of the total number of shares at the time outstanding
having the right to vote for those directors may call a special meeting of
stockholders; or

                         (ii) The Superior Court of the proper county shall,
upon application of such stockholder or stockholders, summarily order a special
meeting of stockholders, to be held to elect the entire board, all in accordance
with Section 305(c) of the CGCL. The term of office of any director shall
terminate upon that election of a successor.

     B.

          1.   Bylaw Amendments

               Subject to paragraph (h) of Section 43 of the Bylaws, the Bylaws
may be altered or amended or new Bylaws adopted by the affirmative vote of at
least sixty-six and two-thirds percent (66-2/3%) of the voting power of all of
the then-outstanding shares of the voting stock of the corporation entitled to
vote. The Board of Directors shall also have the power to adopt, amend, or
repeal Bylaws.

          2.   The directors of the corporation need not be elected by written
ballot unless the Bylaws so provide.

          3.   No action shall be taken by the stockholders of the corporation
except (i) at an annual or special meeting of stockholders called in accordance
with the Bylaws or (ii) by

                                      4.
<PAGE>

written consent of stockholders in accordance with the Bylaws prior to the
closing of the Initial Public Offering, and following the closing of the Initial
Public Offering no action shall be taken by the stockholders by written consent.

          4.   Advance notice of stockholder nominations for the election of
directors and of business to be brought by stockholders before any meeting of
the stockholders of the corporation shall be given in the manner provided in the
Bylaws of the corporation.


                                      VI.

     A. The liability of the directors for monetary damages shall be eliminated
to the fullest extent under applicable law.

     B. This corporation is authorized to provide indemnification of agents (as
defined in Section 317 of the CGCL) for breach of duty to the corporation and
its shareholders through bylaw provisions or through agreements with the agents,
or through shareholder resolutions, or otherwise, in excess of the
indemnification otherwise permitted by Section 317 of the CGCL, subject, at any
time or times the corporation is subject to Section 2115(b) to the limits on
such excess indemnification set forth in Section 204 of the CGCL.

     C. Any repeal or modification of this Article VI shall be prospective and
shall not affect the rights under this Article VI in effect at the time of the
alleged occurrence of any act or omission to act giving rise to liability or
indemnification.

                                     VII.

     A. The corporation reserves the right to amend, alter, change or repeal any
provision contained in this Certificate of Incorporation, in the manner now or
hereafter prescribed by statute, except as provided in paragraph B. of this
Article VII, and all rights conferred upon the stockholders herein are granted
subject to this reservation.

     B. Notwithstanding any other provisions of this Certificate of
Incorporation or any provision of law which might otherwise permit a lesser vote
or no vote, but in addition to any affirmative vote of the holders of any
particular class or series of the Voting Stock required by law, this Certificate
of Incorporation or any Preferred Stock Designation, following the closing of
the Initial Public Offering the affirmative vote of the holders of at least
sixty-six and two-thirds percent (66-2/3%) of the voting power of all of the
then-outstanding shares of the voting stock, voting together as a single class,
shall be required to alter, amend or repeal Article V, VI or VII of this
Certificate of Incorporation.

                                    * * * *

     FOUR:  This Fourth Amended and Restated Certificate of Incorporation has
been duly approved by the Board of Directors of this Corporation.

                                      5.
<PAGE>

     FIVE:  This Fourth Amended and Restated Certificate of Incorporation has
been duly adopted in accordance with the provisions of Sections 228, 242 and 245
of the General Corporation Law of the State of Delaware by the Board of
Directors and the stockholders of the Corporation.

                                      6.
<PAGE>

     In Witness Whereof, Blue Martini Software, Inc. has caused this Fourth
Amended and Restated Certificate of Incorporation to be signed by the President
and the Secretary in San Mateo, California this 28th day of July 2000.


                                    Blue Martini Software, Inc.

                                          /s/ Monte Zweben
                                    By:___________________________________
                                         Monte Zweben
                                         President



Attest:

           /s/ John E. Calonico
     By:________________________
         John Calonico
         Secretary

                                      7.