The screenwriting credits for "Sex Tape" imply that Kate Angelo wrote the initial drafts and that Jason Segel and Nicholas Stoller came in to bat clean-up once Segel was on the film as an actor. I'm not sure that's exactly how it went down, but it would explain the occasional lurch from tone to tone that is part of what keeps "Sex Tape" from working completely.
As set-ups for farce go, "Sex Tape" has a perfectly functional one. Jay (Segel) and Annie (Cameron Diaz) have been married long enough that they're finding their sex lives have bottomed out completely. It's a very real challenge that parents and other married couples face, especially after you have several children in the house. Jay works in the music industry and Annie writes a popular mommy blog which she may be able to sell to a much larger company. I liked that they didn't try to paint the marriage as terrible at the start of the film. There's still plenty of love and respect between Jay and Annie. We see their history as Annie writes about it, and it's fun. It's a little disconcerting to see Segel and Diaz playing college age, but you roll with it because it's just a short bit of the opening.