How Traffic Source and Medium affects your company’s Goal Completions

Do you care to know how Traffic Source and Medium affects your company’s Goal Completions?

If you know which sources and medium combinations drive highest values in goal completions, you can optimize your marketing activities to promote the more favourable combinations. For example, you can increase or decrease paid advertising or organic search along specific channels.

This report shows the past 12 months of data. That means you can see which ones had the most effect for each month of the past year. You would be able to see any changes as a result of past marketing initiatives.

It’s easy to create a custom report that shows Goal completions against Source and Medium

This is what you’re aiming for! You would want this if it were easy to get, and effortless to get fresh data for. Fortunately, that’s exactly what we’re about to describe! Here’s what you get:

google-analytics-source-medium-goal-completions-worksheet-view

Notice that it is automatically sorting by the most recent month. It automatically rolls forward! Using this data, you can publish a chart that looks like this:

google-analytics-source-medium-goal-completions-stackedbar-view

If you have NEXT Analytics installed, it will take you ten seconds to build it…

Open an Excel or Google spreadsheet.

Open a new worksheet.

Rename the worksheet to Traffic_actions.

Copy then paste the following into an Excel worksheet or Google spreadsheet. After doing that, click the Data Refresh button. The goal1 completions for your default Profile will be in your workbook.
Prompt,add,

[GOOGLE_ID],
Prompt,add,[GA_PROFILE_ID],
Prompt,add,[GA_SEGMENT],&segment=gaid::-1
prompt,add,[PERIOD],Past 1 Years
Prompt,add,[MAX_RESULTS],&max-results=1000000
Prompt,add,[GA_DIMENSIONS],"&dimensions=ga:sourceMedium,ga:yearMonth"
Prompt,add,[GA_METRICS],&metrics=ga:goal1Completions
Prompt,add,[GA_SORT],
Prompt,add,[GA_FILTER],
GetGoogleAnalyticsData[GOOGLE_ID],,,[GA_PROFILE_ID],[PERIOD],GoogleData.csv,"[GA_SEGMENT][MAX_RESULTS][GA_DIMENSIONS][GA_METRICS][GA_SORT][GA_FILTER]"
prompt,add,[GA_FIX_DICTIONARY_FULL_FILE_NAMES],""
prompt,add,[GA_COLUMN_AXIS_INDEX],1
prompt,add,[GA_ROW_AXIS_CAPTIONS],Traffic Source and Medium
prompt,add,[GA_ROW_AXIS_INDEXES],0
prompt,add,[GA_METRIC_INDEX],2
prompt,add,[GA_METRIC_AGGREGATION],Sum
prompt,add,[PIVOT_TAB_OUTGOING_DATE_FORMAT],yyyy-MM-dd
prompt,add,[PIVOT_TAB_INCOMING_DATE_FORMAT],yyyy-MM-dd
crosstab,GoogleData.csv,[GA_FIX_DICTIONARY_FULL_FILE_NAMES],utf-8,en-US,True,[GA_COLUMN_AXIS_INDEX],[GA_ROW_AXIS_CAPTIONS],[GA_ROW_AXIS_INDEXES],[GA_METRIC_INDEX],[GA_METRIC_AGGREGATION],,0,1,,
Sort,last,descending
prompt,add,[DATA_SHEET_NAME],Traffic
prompt,add,[TOP_ROW],1
prompt,add,[TOP_LEFT],1
prompt,add,[BOTTOM_ROW],-1
prompt,add,[BOTTOM_RIGHT],-1
SaveInWorksheet2,current,[DATA_SHEET_NAME],Overwrite,invisible,[TOP_ROW],[TOP_LEFT],unformatted,[BOTTOM_ROW],[BOTTOM_RIGHT]

Customize this script

You just pasted text into a workbook. You can easily modify it to suit your specific needs.

This example script will fetch data for the last year. This may not what you want. You can change the [PERIOD] to other time periods such as Past 3 months, for example.

You can, for example, pick a different profile ID, just by putting it’s profile number after the last comma on [GA_PROFILE_ID].

You can choose different metrics by modifying the line that has [GA_METRICS]. The list of metrics is available here:

https://developers.google.com/analytics/devguides/reporting/core/dimsmets

You can also choose a different dimension by modifying the line that has [GA_DIMENSIONS].
If you wish to add more than one dimnension, it’s more involved but still quite possible. You would need to do the following steps:
1. Modify the [GA_DIMENSIONS] insert the extra dimension, in front of the year Month, e.g. ga:userType
2. [GA_ROWS_AXIS_INDEXES] must have a second value for the userType. Change it to 0,1
3. Change [GA_METRIC_INDEX] to 3.
4. CHANGE [GA_COLUMN_AXIS_INDEX] to 2.
If you need any help with this, feel free to post questions in the Forum of our Support page.

2017-02-12T13:06:00-04:00