We show that the results we had previously obtained on diagonals of 9- and 10-parameter families of rational functions in three variables x, y, and z, using creative telescoping, yielding modular forms expressed as pullbacked 2F1 hypergeometric functions, can be obtained much more efficiently by calculating the j-invariant of an elliptic curve canonically associated with the denominator of the rational functions. These results can be drastically generalized by changing the parameters into arbitrary rational functions of the product p=xyz. In other cases where creative telescoping yields pullbacked 2F1 hypergeometric functions, we extend this algebraic geometry approach to other families of rational functions in three or more variables. In particular, we generalize this approach to rational functions in more than three variables when the denominator can be associated to an algebraic variety corresponding to products of elliptic curves, or foliations in elliptic curves. We also extend this approach to rational functions in three variables when the denominator is associated with a genus-two curve such that its Jacobian is a split Jacobian, corresponding to the product of two elliptic curves. We sketch the situation where the denominator of the rational function is associated with algebraic varieties that are not of the general type, having an infinite set of birational automorphisms. We finally provide some examples of rational functions in more than three variables, where the telescopers have pullbacked 2F1 hypergeometric solutions, because the denominator corresponds to an algebraic variety that has a selected elliptic curve.