1. Cleaning Campaign Names
We have come a long way since learning the basics of regular expressions.
2. Recall: REGEXMATCH()
We dove right into regular expression characters and explored different use cases and how to combine them to match specific string sequences and patterns. Then, we used this new understanding and applied it to the three predefined regular expression functions in Google Sheets.
The first regular expression function was REGEXMATCH. This was a simple regex function that would return a boolean value based on whether or not the tested string matched the regular expression.
REGEXMATCH made filtering tables a breeze when combining the filter function with the REGEXMATCH function.
Building on the filtering using REGEXMATCH, we wrapped the FILTER-REGEXMATCH formula in a sum or average function to aggregate the data based on the filtered data and determine campaign costs and subsequent cost-per-clicks.
3. Recall: REGEXREPLACE()
The second regular expression function was REGEXREPLACE. This function was great for making changes to only a portion of a string.
Instead of going through large categorical tables and manually renaming each campaign, you were able to use a REGEXREPLACE function to rename the campaigns, saving a lot of time and minimizing human error.
4. Recall: REGEXEXTRACT()
The last regular expression function was REGEXEXTRACT. This function extracted certain characters or words from a campaign to create campaign IDs.
This made campaign ID creation easier, as it would automatically generate a new campaign ID from the source and campaign name.
5. Chapter wrap-up
In this final lesson, the digital marketing director is going to need the source, campaign, and ad group condensed into a unique id. The digital marketing director and social media team believe this unique id will be easier to keep track of than three columns of data.
Once this ID has been created, the data will be filtered and aggregated to determine cost and cost-per-click for the sources and campaigns.
To achieve this, you will need to use regular expressions to match, extract, and replace strings. Also, recall the filtering and aggregating techniques discussed previously.
6. Let's get to work!
Let's get to work!