The integration between Acoustic Exchange and Google Analytics is a multi-step process that is composed of generating the Acoustic Exchange Capture JavaScript snippet, placing that snippet into your website, overriding the Google Analytics sendHitTask
, and enabling you application in Acoustic Exchange Capture.
Follow the steps listed in this guide to walk through and enable the Acoustic Exchange and Google Analytics JavaScript integration.
- Register Google Analytics registered as an endpoint.
- Add the
sendHitTask
override to your web page. ThesendHitTask
override must be loaded before the Acoustic Exchange Capture JavaScript snippet. - Generate and add the Acoustic Exchange Capture JavaScript snippet to your web page.
- Obtain your Google Analytics event-level authentication key.
- Enable Google Analytics in Acoustic Exchange Capture to complete the integration.
Prerequisites
Acoustic Exchange
- You must have an Acoustic Exchange account.
- You must be a licensed user of an Acoustic Exchange Business Partner solution.
If you do not have an Acoustic Exchange account and are a licensed user of an Acoustic Exchange solution or an Acoustic Exchange Business Partner solution, you can request an Acoustic Exchange account by through Acoustic Support.
Google Analytics
Ensure that you have a Google Analytics account and that you have configured your site according to Google Analytics' requirements.
If you do not have a Google Analytics account, contact the Google Analytics provisioning team. Learn more at Google Analytics Solutions.
For more information on Google Analytics requirements, see the Google Analytics user help.
1. Register Google Analytics as an endpoint
To begin sharing Google Analytics data with Acoustic Exchange and Acoustic Exchange Business Partner Solutions through Acoustic Exchange, Google Analytics must be registered as an endpoint.
Acoustic Exchange requires Read permissions and a refresh token for your Google Analytics account to register as an endpoint. By granting read permissions you are allowing Acoustic Exchange to communicate with your Google Analytics account. After Read permissions are granted, Acoustic Exchange uses the refresh token to securely communicate with your Google Analytics account.
- Log in to Acoustic Exchange.
- On the Endpoints tab, click Register new endpoint to display the endpoint registration wizard.
- Select Google Analytics and click Next, and follow the onscreen instructions to complete the wizard.
2. Add the sendHitTask override
By adding the sendHitTask
override JavaScript snippet to your web page, you are overriding the sendHitTask
in Google Analytics. The JavaScript snippet performs a custom function that causes event data to flow to both Acoustic Exchange and Google Analytics in real time.
The sendHitTask
override captures event data as a hit
and sends it to Google Analytics and the UBX file as a hitPayLoad
. The GAtoUBXEventMapper.js
then maps the data to a UBX naming convention and syntax.
Without the JavaScript snippet, event data does not pass through the Acoustic Exchange GAtoUBXEventMapper.js
or UBX.js
files, and by extension no event data is sent to Acoustic Exchange.
Copy and paste the JavaScript Snippet below into your web page and replace the tracker name with your tracker name.
var tracker = ga.getByName("<REPLACE_TRACKER_NAME>");
var originalSendHitTask = tracker.get("sendHitTask");
tracker.set("sendHitTask", function(model) {
originalSendHitTask(model);
var payLoad = model.get("hitPayload");
console.log("model=" + JSON.stringify(model));
google_ubx.sendEventFromPayload(payLoad, identifiersMapperArray);
When you include the sendHitTask
override in your web page, ensure that it is placed so that it loads after the create tracker method, ga("create", "UA-XXXXX-Y",
"auto");
. For example:
ga("create", "UA-XXXXX-Y", "auto");
ga(function() {
var tracker = ga.getByName("<REPLACE_TRACKER_NAME>");
var originalSendHitTask = tracker.get("sendHitTask");
tracker.set("sendHitTask", function(model) {
originalSendHitTask(model);
var payLoad = model.get("hitPayload");
console.log("model=" + JSON.stringify(model));
google_ubx.sendEventFromPayload(payLoad, identifiersMapperArray);
});
});
Code | Function |
---|---|
originalSendHitTask(model) |
Sends the hit to Google Analytics. |
var payLoad = model.get("hitPayload") |
Retrieves the hitPayload . |
google_ubx.sendEventFromPayload(payLoad, identifiersMapperArray) |
Sends the hitPayLoad to GAtoUBXEventMapper.js . |
3. Add the Acoustic Exchange Capture JavaScript snippet
To perform an Acoustic Exchange Google Analytics integration, you paste the Acoustic Exchange Capture JavaScript Snippet into your web page. This JavaScript snippet is known as an Enablement Key.
You can generate the Acoustic Exchange Capture JavaScript snippet by navigating to Acoustic Exchange Capture from the Tools menu in the Acoustic Exchange user interface. If the Enablement Key screen does not display when you visit Acoustic Exchange Capture, select the Enablement Key icon in the upper right corner of the screen.
When the Acoustic Exchange Capture JavaScript snippet displays, copy the code snippet and paste it into the header of you every web page that also contains Google Analytics code and the sendHitTask
override. The Acoustic Exchange Capture JavaScript snippet must be loaded after the Google Analytics JavaScript and the sendHitTask
override snippet.
4. Obtain your Google Analytics event-level authentication key
When you register an endpoint in Acoustic Exchange, an event-level authentication key is generated for the endpoint. Ensure that Google Analytics is registered as an endpoint.
In the Acoustic Exchange and Google Analytics integration, the event-level authentication key is used to provide a secure means of communication between Google Analytics and Acoustic Exchange. Additionally, the authentication key is required to enable the Acoustic ExchangeAcoustic Exchange Capture JavaScript snippet.
- In Acoustic Exchange, navigate to the Endpoints tab.
- Click
and select Endpoint details.
- Copy and save the key.
5. Enable Google Analytics in Acoustic Exchange Capture
To activate the Acoustic Exchange Capture JavaScript snippet that you embedded in you web page, you need enable your application in the Acoustic Exchange Capture user interface.
- Log in to Acoustic Exchange and navigate to the Tools menu.
- Select Acoustic Exchange Capture.
- In Acoustic Exchange Capture, find and select your application. Follow the instructions on screen to completion.
Comments
0 comments
Please sign in to leave a comment.