API Documentation

KB2013164

The AnalyticsConnect.io API lets users override their default AnalyticsConnect.io account settings and manipulate where the data gets sent on a page by page basis. It can be used to change the Google Analytics account destination (to send data to a variety of Google Analytics accounts), change the Google AdWords account destination (to send data to a variety of Google AdWords accounts), change the Google AdWords Conversion info (to record a variety of goals inside of AdWords), change the Facebook Conversion Pixel ID (to record a variety of goals inside of Facebook Advertising), and/or change the Bing Tag ID (to record a variety of goals inside of Bing Advertising).

First ask yourself if you really need to use the API. Most websites should have no more than: one Google Analytics account, one AdWords conversion named "sale", one Facebook conversion named "sale", one Bing conversion named "sale", and one "sale" thank-you page. The simpler you keep things, the easier it will be to make use of the data. Do NOT use multiple conversions inside AdWords because you want to segment the data, as this can be done from inside your Google Analytics Ecommerce reports far easier. If you are considering using the API, you can contact us first to see if there is a simpler way to accomplish your goal. In most cases the API is used by people running multiple websites for multiple businesses through one Infusionsoft account. For those who need it, you'll find different instructions below depending on what version of our software you're using (WordPress Plugin or PHP Plugin).

WordPress Plugin

The basic WordPress setup requires you to place the shortcode [analyticsconnect-io] on your thank-you page. You can modify the behavior by adding attributes to this shortcode. The available attributes are:

gaua - Google Analytics Tracking ID

awconid - Google AdWords Conversion ID

awconlabel - Google AdWords Conversion Label

fbconpixelid - Facebook Conversion Pixel ID

bingtagid - Bing Tag ID

The syntax is attribute="value" which is added inside the shortcode. As an example, if we wanted to send data to the Google Analytics account of UA-XXXXX-YY we would add the following code:

[analyticsconnect-io gaua="UA-XXXXX-YY"]

If we wanted to change the AdWords Conversion ID and Label, we would change the shortcode to:

[analyticsconnect-io awconid="1234567" awconlabel="ABCDEFG"]

The attributes can be used in any combination or order.

Please Note: If you are changing any AdWords, Facebook, or Bing settings, be sure that you have enabled AdWords and/or Facebook and/or Bing on your settings page.

PHP Plugin

The basic PHP setup requires you to place the following code on your thank-you page.

<?php
require 'analyticsconnect-io/analyticsconnect-io.php';
?>

You can modify the behavior by defining attributes before the require statement. The available attributes are:

ANALYTICS_CONNECT_IO_GAUA - Google Analytics Tracking ID

ANALYTICS_CONNECT_IO_AWCONID - Google AdWords Conversion ID

ANALYTICS_CONNECT_IO_AWCONLABEL - Google AdWords Conversion Label

ANALYTICS_CONNECT_IO_FBCONPIXELID - Facebook Conversion Pixel ID

ANALYTICS_CONNECT_IO_BINGTAGID - Bing Tag ID

The syntax is define('ATTRIBUTE', 'value'); for each attribute you want to define. As an example, if we wanted to send data to the Google Analytics account of UA-XXXXX-YY we would add the following code:

<?php
define('ANALYTICS_CONNECT_IO_GAUA', 'UA-XXXXX-YY');
require 'analyticsconnect-io/analyticsconnect-io.php';
?>

If we wanted to change the AdWords Conversion ID and Label, we would add the following code:

<?php
define('ANALYTICS_CONNECT_IO_AWCONID', '1234567');
define('ANALYTICS_CONNECT_IO_AWCONLABEL', 'ABCDEFG');
require 'analyticsconnect-io/analyticsconnect-io.php';
?>

The attributes can be used in any combination or order.

Please Note: If you are changing any AdWords, Facebook, or Bing settings, be sure that you have enabled AdWords and/or Facebook and/or Bing on your settings page.

Related Resources

None

Article Feedback

If this article is incorrect or outdated, or omits critical information, please use our contact us form and let us know.