Back to Documentation Overview
campaignAnalytics
public static campaignAnalytics(string apikey, string cid)
Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.
- Section:
- Campaign Stats
- Parameters:
apikey a valid API Key for your user account. Get by calling login() cid the campaign id to pull bounces for (can be gathered using campaigns()) - Returns:
- array - analytics we've collected for the passed campaign.
- Returned Fields:
integer visits number of visits integer pages number of page views integer new_visits new visits recorded integer bounces vistors who "bounced" from your site double time_on_site integer goal_conversions number of goals converted double goal_value value of conversion in dollars double revenue revenue generated by campaign integer transactions number of transactions tracked integer ecomm_conversions number Ecommerce transactions tracked array goals an array containing goal names and number of conversions - <?php
- /**
- This Example shows how to retrieve Analytics data collected for a campaign with
- some basic error checking.
- **/
- require_once 'inc/MCAPI.class.php';
- require_once 'inc/config.inc.php'; //contains apikey
- $stats = $api->campaignAnalytics($campaignId);
- if ($api->errorCode){
- } else {
- if ($stat['goals']){
- foreach($stat['goals'] as $goal){
- }
- }
- }
- ?>
Examples (1)
download example code[1] mcapi_campaignAnalytics.php
|
Add New Note
User Contributed Notes for
campaignAnalytics |
|---|
| No notes, yet... Will you be the first?? |