Google Analytics Documentation:

Google Analytics 4 (GA4) is the new standard for measurement in Google Analytics, to read more on Google Analytics itself please visit their knowledge base:

https://support.google.com/analytics/answer/10089681?hl=en


This integration uses the Google Measurement Protocol endpoints, more information on these can be found here:

https://developers.google.com/analytics/devguides/collection/protocol/ga4

https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=gtag#required_parameters



Google Analytics 4 Configuration:

To begin we need to create a data stream and API key. Start by logging into your Google Analytics 4 property and click on Admin in the bottom left:        



Next, click on 'Data Streams'



If you don't have a data stream setup, please create one, more information on doing this is below:

https://support.google.com/analytics/answer/9304153?hl=en


Click on the relevant data stream you will be associating to the events:



You will then need to make a note of the Measurement ID (NOT stream ID). Once noted, click on 'Measurement Protocol API Secrets' to create and API key:



Click on 'Create' and enter a nickname for your API key, in this case we have used 'PhoneCalls'. Once created there will be a secret value, make a note as this is your API key.



Fone Dynamics Platform


Login to the Fone Dynamics Platform & navigate to the Integrations section.



*If you require a login to the Platform or the Integrations option is not displayed, please contact the Fone Dynamics Operations Team or your Account Manager for assistance.


Integrations Setup


From the Integrations section, click on Templates & then select Google Analytics



From the pop out window, choose the Project to be provisioned with the Template & then select Install



Once the Template is installed, the Recipe (Integration) will become available from the Assets tab.


Click on Assets from the Integrations section & then click on the GA4 Recipe to begin configuration



Connection Setup:


Now click on the Connections tab on the top bar to configure the FoneDynamics and Google Analytics Connections for this Recipe:



The FoneDynamics Connection will require your Account SID & API Token details:



A guide on how to obtain your Account SID & API Token details can be found here


Copy the Account SID & API Token details into their corresponding fields of the FoneDynamics Connection and then click Connect.


Now select the GA4 Connection, name the connection & enter your Measurement ID & Api secret from your Google Account Then click Connect & once the GA4 connection is successfully connected, click on Edit recipe



Overview


The Recipe is already pre-populated, & generally the defaults will be sufficient for most clients, however they can be modified to suit your requirements.



Breakdown of the Recipe steps:


1.- Trigger


It initiates the recipe actions, follows in-sequence delivery, maintains processed job records, prevents duplicate processing, and ensures job completion in order.



By default, the trigger in this recipe is already configured, but if you want to tweak the options, you may



Time Unit: The interval used to trigger the recipe (minutes, hours, days, weeks, months, custom).

Timezone: Area where the business is based.

Trigger every: Insert the value related to the time unit.


ACTIONS

Every recipe contains a set of actions, which dictates the nature and the steps the integration is going to follow.


2.- Call Query


Select the step 2 node to define the Resource Level which determines the extent to which information will be pulled out from the queries. 

 


Then use the dropdown menu from the right hand pane to select the Resource level


 

From the dropdown menu the choices available are Account, Property & Single Call


Property level will extract all call conversions for the specified property & is generally sufficient for most clients needs, but if you have multiple properties on a single account & wish to consolidate the data, Account may be preferential



Examples


Property


If Property is selected as the Resource Level, ensure the PropertySID field is populated with the PropertySid datapill from the Recipe Data pop up screen


This can be dragged across & dropped into the Property SID field if required



Account



Single Call


If Single Call is selected as the Resource Level, ensure the Calling job ID field is populated with the Calling job ID datapill from the Recipe Data pop up screen


This can be dragged across & dropped into the Call SID field if required



Now click Save to ensure your progress is saved


Optional fields:


Optional fields can be added to the query


Date_From:

Date_To:

Disposition:

To:

Endpoint:

Attribute_Source:

Attribute_ Medium:

Attribute_ Campaign:

Attribute_ Content:

Promp_Keys:

Unique:

Results_Count:

Results_Skip:


Full explanations of these are available in our Rest API Docs:

https://www.fonedynamics.com/docs/rest-api/get-calls/


3.- IF (conditional)


IF will choose a path based on if the specified conditions are met or not.


Example: The CallSid is not present/new - NO / the CallSid is present/existing - YES.


If the CallSid already exists, then it won't action any further.

If the CallSid is a new entry, it proceeds to action the query.


4.- Stop

Stops the job, and no query is actioned for that existing CallSid.


5.-Repeat for each

The integration will then iterate over the list of calls given by the first query, this may be blank if no calls were found.



6.- Sending the query to your Google Analytics account

The HTTP method sends a POST request in accordance with Googles docs after performing some data transformation steps, if you are a user of dynamic call tracking it will also try to upload Google Analytics Client IDs if they were found when the visitor visited your web page. Otherwise it will upload a hash of the callSID.


Any available call data will be synced, otherwise we return a null value for the field on upload. 

You can change the payload data being sent but doing so can be tricky, we recommend getting in touch with us to assist with changes to this field and we can put you in touch with advanced support to facilitate these changes.


For more information Google’s measurement protocol please visit:

https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=gtag


Now that you have completed the Recipe configuration, proceed to click Save & Exit



And finally, click on Start recipe


--------------------------------------------------------------

(OPTIONAL) Custom Definitions

Custom definitions can be defined with the Google Analytics environment, note that you can only create custom definitions if events (calls) with the relevant values and fields have been synced prior.


For instance, if you would like to create a custom dimension for IVR entries, unless you have synced a call with IVR data can you see this as a configurable option.


To setup custom definitions, open the sidebar, click on Admin and then click on 'Custom Definitions':





Click on 'Create custom dimensions':



You can name the dimension anything and describe the event as you wish however the scope should remain as an 'Event'. Once completed you then need to select an existing event parameter, if you have synced calls for more than 24 hours it should show all the event parameters available to you:



Once you have added a custom dimension, any new events will automatically use this event parameter and you can then use it to report on:






(Optional) Converting events into conversions


Conversions are the universal analytics equivalent to goals. We can choose to mark conversions for all calls or a subset of calls by defining an audience. To setup a conversion, open up the admin panel and click on 'conversions'.







Next, click on 'New Conversion Event':



enter the name to be the same as the event name you specified in the integration setup, this will then mark all events as a conversion.





In order to track a specific audience you can create a new audience by going into the admin panel and clicking on 'Audiences':




Click on 'New Audience':




Under 'Start from scratch' click on 'Create a custom audience':




From here we are given a screen whereby we can customise the conditions that match our audience. First select the event and then you add specific parameters of that event:




Any custom definitions you have created appear under 'custom' and standard event parameters are shown under 'other':


Using the 'To' field as an example, we can choose to create an audience which has called a specific phone number:



You can also add more numbers using OR or AND statements, or by usign the condition/sequencing options:




We now need to add members of this audience who match the criteria into a new event for tracking, to do this, create a new audience trigger:



This new event can be named whatever you wish:


After saving the audience trigger and the audience you should be able to view this:




With the new event now created you can follow the previous steps if you wish to make this new event into a conversion, just replace the name of the event with the newly created event name.