Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable GA 'Remarketing and Advertising Reporting Features' ? #153

Closed
kevin-finesse opened this issue Sep 23, 2015 · 15 comments
Closed

Enable GA 'Remarketing and Advertising Reporting Features' ? #153

kevin-finesse opened this issue Sep 23, 2015 · 15 comments
Milestone

Comments

@kevin-finesse
Copy link

I've used this plugin on several phonegap build apps and have always been delighted with how simple it is to install and use - many thanks. Now I have a client that wants to enable the google analytics 'remarketing and advertising features'. Is there any way of doing that with this plugin?

regards
Kevin

@ghost
Copy link

ghost commented Nov 12, 2015

Any news on that ?

@ghost
Copy link

ghost commented Nov 12, 2015

@gillesBzk
Copy link

Hello Dan !
Are you thinking ti implement this feature ?
Thanks
Gilles

@CodingCarlos
Copy link

Hi Dan!! I'm also very interested on this. Are you thinking on it?

@CodingCarlos
Copy link

Right now I'm not at home (easter, you now...) and I have not my computer for testing, but I think that adding support for this function could be as easy as this:

For Android:

At android/UniversalAnalyticsPlugin.java:

Add a new var for enable remarketing
public static final String ENABLE_ADVERTISING_ID_COLLECTION = "enableAdvertisingIdCollection";

In the execute(), add an option to the "else if":

} else if (ENABLE_ADVERTISING_ID_COLLECTION.equals(action)) {
    boolean option = args.getBoolean(0);
    this.enableAdvertisingIdCollection(option, callbackContext);
    return true;
}

And after all functions, add the one called in the previous conditional:

private void enableAdvertisingIdCollection(boolean option, CallbackContext callbackContext) {
    if (! trackerStarted ) {
        callbackContext.error("Tracker not started");
        return;
    }

    if (null != option) {
        tracker.enableAdvertisingIdCollection(option);
        callbackContext.success("Advertising id collection setted to: " + option);
    } else {
        callbackContext.error("option is not valid");
    }
}

At www/analytics.js:

Before exporting the module, add the following code:

UniversalAnalyticsPlugin.prototype.enableAdvertisingIdCollection= function(option, success, error) {
  cordova.exec(success, error, 'UniversalAnalytics', 'enableAdvertisingIdCollection', [option]);
};

For iOS

I have never done anything for iOS, so I have no idea of how it works 😢

@zanemcca
Copy link

+1

@JimWhiteheadMR
Copy link

JimWhiteheadMR commented Jul 2, 2016

+1 on this feature request.

FWIW, in my iOS project I just followed the instructions given here:
https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad#app
under the section "App-tracking code change for iOS" (located in section, "Enable Remarketing and Advertising Reporting Features for an app")

This section states:

To enable these features for iOS, collect the IDFA (Identifier for Advertisers). To enable IDFA collection, link the libAdIdAccess.a and AdSupport.framework libraries to your application and set the allowIDFACollection to YES on each tracker that will collect the IDFA. For example:

// Assumes a tracker has already been initialized with a property ID, otherwise
// getDefaultTracker returns nil.
id tracker = [[GAI sharedInstance] defaultTracker];

// Enable IDFA collection.
tracker.allowIDFACollection = YES;

To implement this, I:

  • Added the "tracker.allowIDFACollection = YES" line after each instance of "id tracker == [[GAI sharedInstance] defaultTracker]" in UniversalAnalyticsPlugin.m
  • Added in the library "libAdIdAccess.a" (found in the Google Analytics for iOS SDK at: https://developers.google.com/analytics/devguides/collection/ios/v3/sdk-download
  • Added in "AdSupport.framework" (no download needed, visible in XCode)
  • Added the following line to the plugin.xml file for cordova-plugin-google-analytics:

<source-file src="ios/libAdIdAccess.a" framework="true" />

I'm not yet sure whether this will work. At the very least, it doesn't seem to cause any harm. If it seems to work, I'll submit a pull request.

@victorsosa
Copy link
Collaborator

fixed

@paramesh016
Copy link

wow thanks a lot , i was facing this issue
Wouldn't have done without your support .Thanks a lot

@victorsosa
Copy link
Collaborator

@paramesh016 you welcome

@paramesh016
Copy link

Hi i have one doubt ,even after adding the below line
window.analytics.setAllowIDFACollection(true);
and there is no error in the console
and after enabling demographics in my google analytics account

i shows "There is no data for this view."
booble boy

can u help pls with this please .thank you

@victorsosa
Copy link
Collaborator

@paramesh016 please open a new issue with this bug

@paramesh016
Copy link

@victorsosa : Sure
and also i am not able to enable see "data collection"

google analytics

instead of having this way (below) :

google analytics2

because here i should enable "Remarketing and Advertising report features" so that i get demographics reporting data , since i am not able to see data collection .I am not able to enable it .Please provide if u have any solution on this

and sorry if i am being unproffesional

@Lyncros
Copy link

Lyncros commented Nov 15, 2016

Hello @victorsosa I'm also tryinig to implement remarketing in my app, which I'm compiling trough phonegap and it doesn´t seem to be logging remarketing information. I'm not planning to display adds in my app, just be able to display google ads to those who downloaded it in the last 30 days.
Could you give me a hint as of where to look to fix the problem?

@victorsosa
Copy link
Collaborator

@Lyncros please check issue #274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants