Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.

Auto-generating Google Campaign URLs with Smartsheet?

I would love to create and manage Google Campaign URLs with Smartsheet. Ideally, I would enter the URL and associated variables, and in the final column it would generate the complete campaign URL, just like the official Google URL builder (https://ga-dev-tools.appspot.com/campaign-url-builder/).

Specifically, I suppose the final column would check a cell to see if it has a value, and if it has the value, input into the URL formula appropriately. The output would look something like:

(A1)[?utm_source=(B1)][&utm_campaign=(C1)][&utm_medium=(D1)]

Does anyone know how I might go about making something like that happen? Thanks in advance.

Comments

  • JamesR
    JamesR ✭✭✭✭✭✭

    You would need a column for each element, then a cloumn for the full address which you would construct with the Concaternate formula including any HTML charachers required.

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Here's an example:

    ="www.google.com/maps/place/" + SUBSTITUTE(JOIN([Street Address]1:Zip1, "+"), " ", "+")

    This takes 4 columns (starting at [Street Address] and ending as [Zip]) to create a Google Maps link. (The other two are [City] and [State] in case you were wondering)

    The SUBSTITUTE function replaces spaces with the plus (+) sign.

    Craig

  • Thanks - I was just trying to find documentation on the sytanx to use but it's simplier than I thought; simple =[Cell1]R# + "string" + [Cell2]R#

    I ended up using this formulate and it works exactly as intended:

    =[URL*]21 + "/?utm_source=" + [Campaign Source*]21 + "&utm_campaign=" + [Campaign Name*]21 + "&utm_medium=" + [Campaign Medium*]21

    (Columns: URL*, Campaign Source*, Campaign Name*, Campaign Medium*, and the formula goes into a colum "Final URL" )

    Now, what I'd really like to do is add logic to the formula - "If([Campaign Medium]is NOT null then "+&utm_medium"+"[Campaign Medium]" so that if there is a term in the cell it adds it to the URL, but if there is not a term, it doesn't -- is that possible? I've found some documentation on "IF" but not "not null."

    Edit: I figured it out! The "ISBLANK" statement is formatted to provide "If blank = statement" and "If not blank = statement" already. The documentation is just really unclear on that.

    So by entering the statement "IF(ISBLANK([Campaign Source*]), "", "&campaign_source" + [Campaign Source]) in my overall statement it worked as intended. Woo!

    Here's the full statement, hope it helps!

    Columns (* indicates required according to Google URL's campaign builder)

    URL*

    Campaign Source*

    Campaign Name*

    Campaign Medium*

    Campaign Term

    Campagin Content

    Formula:

    =[URL*]1 + "/?utm_source=" + [Campaign Source*]1 + "&utm_campaign=" + [Campaign Name*]1 + "&utm_medium=" + [Campaign Medium*]1 + IF(ISBLANK([Campaign Term]1), "", "&utm_term=" + [Campaign Term]1) + IF(ISBLANK([Campaign Content]1), "", " &utm_content=" + [Campaign Content]1)

  • This was really helpful.

    Any suggestions on how the formula might change if you sometimes have URLs that already have a ? (question mark) as part of the original destination URL?

    For example, say your URL looks like this:

    https://mydomain.com/register/?id=c17b446a-8743-4825-8ae3-cc615c0b2ebe

    when I add my UTM codes using the formula provided in this discussion thread above to my Smartsheet, then the URL will fail given that it has two question marks in the URL.

    https://mydomain.com/register/?id=c17b446a-8743-4825-8ae3-cc615c0b2ebe?utm_medium=email&utm_source=crm&utm_campaign=event-ll&utm_term=adm-sp19-ll

    Am I able to build any logic into the Smartsheet formula that would spot the ? in the original URL and instead insert a & in the URL

    https://mydomain.com/register/?id=c17b446a-8743-4825-8ae3-cc615c0b2ebe&utm_medium=email&utm_source=crm&utm_campaign=event-ll&utm_term=adm-sp19-ll

    Any suggestions on how to handle this. Unfortunately our event registration URLs have a ? in the URL.

    Thanks for your help.

    Doug

  • This has been hugely valuable - but I get a break after the IF(ISBLANK([Campaign Term]1),.

    I think the "" is giving a space? Also - what is the 1 for after each column title?

This discussion has been closed.
Hi, <\/p>

Instead of applying the formula to \"Multiselect Text String\" row, did you tried with \"Multiselect Values\" row?<\/p>

=IF(HAS([Multiselect Values]@row, [Component ID]@row), \"MATCH\", \"NO MATCH\")<\/p>

Thank you,<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":109493,"type":"question","name":"I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","excerpt":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5 different statuses in a separate column. So using the screenshot I've provided as an example (although it doesn't have 5 different statuses in the…","snippet":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5…","categoryID":322,"dateInserted":"2023-08-25T20:03:21+00:00","dateUpdated":null,"dateLastComment":"2023-08-26T00:34:49+00:00","insertUserID":165710,"insertUser":{"userID":165710,"name":"SmarsheetNewb","url":"https:\/\/community.smartsheet.com\/profile\/SmarsheetNewb","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-26T00:33:27+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":161714,"lastUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-27T02:16:35+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":26,"score":null,"hot":3386005690,"url":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109493,"commentID":392692,"name":"Re: I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392692#Comment_392692","dateInserted":"2023-08-26T00:34:49+00:00","insertUserID":161714,"insertUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-27T02:16:35+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-26T00:33:25+00:00","dateAnswered":"2023-08-25T20:44:12+00:00","acceptedAnswers":[{"commentID":392662,"body":"

Try this:<\/p>

=COUNTIFS([Item Number]:[Item Number], OR(@cell = \"C001\", @cell = \"COO2\", @cell = \"COO3\", @cell = \"COO4\"), [Status]:[Status], OR(@cell = \"Green\", @cell = \"Yellow\", @cell = \"Red\"))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"formulas","name":"Formulas"}]},{"discussionID":109500,"type":"question","name":"Auto-populate emails on a \"contact list\" column","excerpt":"I have a Form created for internal employees where they can submit request tickets to my department. We all have an account with Smartsheet. One of our columns (\"Requestor Name\") is in the Form where they type in their names. The \"Requestor Name\" column is a Contac List column. My issue here is, how can I have Smartsheet…","snippet":"I have a Form created for internal employees where they can submit request tickets to my department. We all have an account with Smartsheet. One of our columns (\"Requestor Name\")…","categoryID":321,"dateInserted":"2023-08-25T21:43:36+00:00","dateUpdated":"2023-08-25T21:44:14+00:00","dateLastComment":"2023-08-25T22:14:15+00:00","insertUserID":164850,"insertUser":{"userID":164850,"name":"ocanel","title":"Analyst","url":"https:\/\/community.smartsheet.com\/profile\/ocanel","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-27T06:55:05+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":164850,"lastUserID":165374,"lastUser":{"userID":165374,"name":"Shanky Paul","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/Shanky%20Paul","photoUrl":"https:\/\/lh3.googleusercontent.com\/a\/AAcHTtcAdE60g-MBEj1rR28GVz9zn6RmbZsmEQm5EiEV=s96-c","dateLastActive":"2023-08-26T21:35:09+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":1,"countViews":23,"score":null,"hot":3386002071,"url":"https:\/\/community.smartsheet.com\/discussion\/109500\/auto-populate-emails-on-a-contact-list-column","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109500\/auto-populate-emails-on-a-contact-list-column","format":"Rich","tagIDs":[204,247,334,448,527],"lastPost":{"discussionID":109500,"commentID":392677,"name":"Re: Auto-populate emails on a \"contact list\" column","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392677#Comment_392677","dateInserted":"2023-08-25T22:14:15+00:00","insertUserID":165374,"insertUser":{"userID":165374,"name":"Shanky Paul","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/Shanky%20Paul","photoUrl":"https:\/\/lh3.googleusercontent.com\/a\/AAcHTtcAdE60g-MBEj1rR28GVz9zn6RmbZsmEQm5EiEV=s96-c","dateLastActive":"2023-08-26T21:35:09+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-27T06:55:03+00:00","dateAnswered":"2023-08-25T22:14:15+00:00","acceptedAnswers":[{"commentID":392677,"body":"

Hi, <\/p>

Add a \"Created By\" column in your sheet and turn on \"Required smartsheet login to access your form\" in your form setting. So that whoever fills out the form, their email id will be automatically captured in \"created by\" column. This will replace your \"Requestor Name\" column. <\/p>

Thank you!<\/p>


<\/p>

\n
\n \n \"Screen<\/img><\/a>\n <\/div>\n<\/div>\n
\n
\n \n \"Screen<\/img><\/a>\n <\/div>\n<\/div>\n


<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":204,"urlcode":"forms","name":"Forms"},{"tagID":247,"urlcode":"contacts","name":"Contacts"},{"tagID":334,"urlcode":"automations","name":"Automations"},{"tagID":448,"urlcode":"workflows-in-smartsheet","name":"Workflows in Smartsheet"},{"tagID":527,"urlcode":"columns","name":"columns"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&siteSectionID=0&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending Posts