This article guides you through a custom workflow that utilizes Zapier & Google Sheets to extract UTM parameters from the embedded widget.
Requirements:
- Roof Quote PRO™ active subscription
- Admin user access
- Zapier account
- Google account
Overview:
RoofQuote PRO is designed to emit Javascript events from the tool making it possible to track your users' interactions from within the tool. If you are trying to track UTM parameters (ex: utm_medium, utm_campaign, etc) and are not leveraging a tool like Google Tag Manager, this setup will allow you to capture these variables.
We will be leaning on the externalUrl variable from our Webhooks feature.
Instructions:
- To start, login to your Zapier account
- Click the "+ Create" button
- Choose "Zaps." Next we will need to add the workflow to the Zap...
- Create Trigger for Zap
- Click the button that says Trigger and select 'Webhooks' from the actions.
- Select 'Catch Hook' as the Trigger event.
- Copy the Webhook URL under the Test tab.
- Click the button that says Trigger and select 'Webhooks' from the actions.
- Add Webhook URL to RQP Dashboard
- Open up a new tab or window, navigate to app.roofle.com and login
- Inside your RoofQuotePRO dashboard, find the Settings or gear icon
- Choose Developer on the ensuing pop up menu
- Once on the Developer page, select the Webhooks tab
- Paste in the Zap Webhook URL to the fielder while under the Contact Form Completed type.
- NOTE: Be sure to remove the "https://" from the pasted URL
- Click Save Changes
- Test the Zap
- Navigate to a deployed version of your RoofQuote PRO widget on your website.
- Ensure that utm_params are being passed after a " ?" in the URL
- Enter in a serviceable address and test lead contact info
- Select the "See My Prices" (or equivalent) button. This will trigger the webhook and send the data load to Zapier.
- Navigate to Zapier.
- Find the Catch Webhook action again and select the Test tab
- Click on the Test trigger button
- Reload the list and the test lead will populate. Ensure that the UTM parameters were passed by finding the External Url in the data list.
- Add Split Formatter to Zap
- Click the button that says Action and select 'Formatter' from the actions.
- From the Action event dropdown, select 'Text'.
- Under the Configure tab, choose 'Split Text' from the Transform dropdown.
- In the 'Input' field, enter a backslash " / " and then start typing "External Url". Once it auto populates, select that field.
- Under the 'Seperator' field, enter a " ? "
- This will divide everything after the ? in your page URL in order to capture the UTM parameters
- Click the button that says Action and select 'Formatter' from the actions.
- Add Extractor Formatter to Zap
- Select 'Add Step' or ' + ' button under the first Formatter. Select Formatter again from the actions.
- From the Action event dropdown, select 'Text'.
- Under the Configure tab, choose 'Extract Pattern' from the Transform dropdown.
- In the 'Input' field, enter a backslash " / " and then select the Formatter from the previous step. Then select the output from that action.
- Under the 'Pattern' field, enter the variable you want to isolate and then a Regex pattern to ensure all characters are captured. In the example below, the utm_source parameter is being isolated.
- ex: utm_source=([^&]+)
- ex: utm_source=([^&]+)
- Select 'Add Step' or ' + ' button under the first Formatter. Select Formatter again from the actions.
- Repeat Step 4 for Each UTM Parameter
- Repeat the Extractor Formatter setup for each parameter in your URL
- The only step that needs to be modified is the 'Pattern' field. Ensure you change that to a new UTM parameter. The same Regex pattern can be used.
- ex: utm_campaign=([^&]+)
- ex: utm_medium=([^&]+)
- Create New Google Sheet
- Under your Google account, navigate to Google Sheets
- Create a new blank spreadsheet
- Rename the spreadsheet
- Next, right click the first row (Row 1)
- From the dropdown, navigate to 'View more row actions' and then select Freeze up to row 1. This will prevent the header row from being affected.
- In this newly frozen header row, add the UTM parameters name in each column. Start with Column A.
- Add Google Sheets Injector Action
- Select 'Add Step' or ' + ' button under all of the Formatters. Select Google Sheets from the actions.
- On the 'Setup' tab of the Google Sheets action, choose the Action event dropdown.
- Select Create Spreadsheet Row from the list.
- Next, choose the corresponding Google account that owns the spreadsheet you want to use.
- Under the Configure tab, choose the existing Google Sheets document from the Spreadsheets dropdown. Next select the the Worksheet.
- Once both are selected, you will be able to edit the data source for your UTM parameters.
- In the example above, the following parameters are being isolated: utm_source, utm_medium & utm_campaign.
- In each applicable utm field, enter a backslash " / " and select the appropriate Formatter for that variable. Then select the output from that action.
- Rename each Extractor Formatter as the UTM paramter to make this step easier. Use the pencil icon at the top of each Formatter page.
- Select 'Add Step' or ' + ' button under all of the Formatters. Select Google Sheets from the actions.
- Publish
- If setup correctly, the params will be automatically added into their corresponding columns on the Google Sheet.
- When ready to publish, simply swipe over on the Google Sheets tab in Zapier and select Publish.