There is a patch that allows you to select whether you'd like the standard Google Analytics URL (www.google-analytics.net/ga.js) or the Double Click URL (stats.g.doubleclick.net/dc.js). That's it.

I added a flag in the Admin screen so one can make the change there. The default remains the same.

The reason behind using the Double Click is to enable tracking of AdWord along Google Analytics and as a result get better advertising in front of our customers.

Thank you.
Alexis Wilke

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Status: Needs review » Needs work

D7 first, please. There are unrelated code style changes that need to be corrected. Please keep the current code style. The tracking url setting should be made more generic. We had one request in past to support a beta tracker url, too. I have not found docs about this and closed the case for this reason. I'm not sure if more spamming advertising networks come up in near future that use the same logic. Let's use a selectbox.

AlexisWilke’s picture

Assigned: AlexisWilke » Unassigned

I don't have 7.x. But if others using 6.x wanted the capability, it's in my patch. I also don't see the need to make my patch better since it's for 6.x.

As for the doubleclick feature, if you go to GoogleAnalytics, you'll see a checkbox when you go get the code. Click on the doubleclick checkbox and you'll see that the code changes the way I have it in my patch. I would imagine 7.x will do the same thing.

Thank you.
Alexis

drinkynet’s picture

I've recently run into the need to swap out the standard library for the doubleclick one to enable AdWords remarketing features at work too.

Here is a patch that adds a switch to the advanced settings which allows you to choose between the standard Google Analytics tracking package and the Google Doubleclick package.

Its based on this Google article:
http://support.google.com/analytics/bin/answer.py?hl=en&answer=2444872

Switching to the Doubleclick library has a privacy policy implication, a note about this is included in the description on the doubleclick radio field.

hass’s picture

There are TABs and trailing spaces inside. Please make sure the patch is not ignored by the test robot. Please also extend the tests. Otherwise the patch looks ok to me.

drinkynet’s picture

Status: Needs work » Needs review
FileSize
4.67 KB

Ahh TABs & trailing space :( added a test for the alternate library

Status: Needs review » Needs work

The last submitted patch, google_analytics-1.x-doubleclick-7.x.patch, failed testing.

drinkynet’s picture

Status: Needs work » Needs review
FileSize
4.65 KB

Retrying the test

hass’s picture

Status: Needs review » Needs work
+++ b/googleanalytics.admin.incundefined
@@ -354,6 +354,15 @@ function googleanalytics_admin_settings_form($form_state) {
+    '#default_value' => variable_get('googleanalytics_tracking_library', 0),  	

Trailing space

drinkynet’s picture

Status: Needs work » Needs review
FileSize
4.65 KB

This time without the trailing spaces :)

remkovdz’s picture

Is this already included in a new release of the Google Analytics module?

drinkynet’s picture

I wouldn't have thought so, as this issue is still in the needs review state.

hass’s picture

I'd like to commit this as close as possible to the wordings used on the Google site, but in my German account I still don't see this doubleclick stuff. Can someone share a screenshot from his account Tracking Code tab, where you can enable all features and Google generates the code for your site, maybe anonymized if have a problem with the details.

Anonymous’s picture

To activate this option on Google Analytics site you must update your tracking code using stats.g.doubleclick.net/dc.js in your site: http://support.google.com/analytics/bin/answer.py?hl=en&answer=2611270 and to see a screenshot: http://support.google.com/analytics/bin/answer.py?hl=en&answer=2611404

Regards,

AlexisWilke’s picture

FileSize
103.3 KB

Do a View Image to see it 1:1 scale.
Google Analytics sample screenshot

hass’s picture

THX, I really do not have this checkbox in my account... :-(

drinkynet’s picture

Do you have an AdWords account linked to your Analytics account?

hass’s picture

No. But AdWords is a different checkbox and I see this AdWords checkbox. I guess the feature is tooo new and it takes Google many months to enable it for all accounts.

remkovdz’s picture

It says here exactly how the tracking code should be modified:
http://support.google.com/analytics/bin/answer.py?hl=en&answer=2444872

There is no need to see a checkbox in your Analytics account since we don't copy the code that is supplied there: we use the one generated by the Google Analytics module.

hass’s picture

@remkovdz: Put mind in gear, before opening mouth! thx

remkovdz’s picture

Sorry, just trying to help :)

drinkynet’s picture

It's a feature that is being rolled out at the moment see this: http://analytics.blogspot.ca/2012/07/a-simpler-way-to-reconnect.html

You need an AdWords account hooked up to your Analytics account to qualify for the additional buttons in Analytics, and they are being rolled out over the summer.

This explains the remarketing feature better:
http://support.google.com/analytics/bin/answer.py?hl=en&answer=2611268&t...

drinkynet’s picture

Some of our other Analytics accounts now have this feature rolled out to them, do you see the boxes yet?

remkovdz’s picture

I can confirm my Analytics accounts now show the option for Remarketing Lists (Netherlands).

hass’s picture

Is one of you guys a native English speaker? What is better/correct: t('Search and Advertising') or t('Search and Advertisement')?

hass’s picture

New patch with a caching bug fixed. I moved it below previous Search and AdSense section and renamed the sections.

hass’s picture

Status: Needs review » Fixed

Committed to D7 http://drupalcode.org/project/google_analytics.git/commit/dd9cda1

If someone needs this for D6, jump in and backport, please.

remkovdz’s picture

I just downloaded the latest dev, however I don't see the patch changes in the dev-files?

hass’s picture

DEV's will be refreshed once every 12 hours only. Please be patient it's only 5 hours from now...

remkovdz’s picture

:-) Did not know that, thanks.

drinkynet’s picture

Is one of you guys a native English speaker? What is better/correct: t('Search and Advertising') or t('Search and Advertisement')?

t('Search and Advertising') is probably better since Advertising is what you are doing

remkovdz’s picture

Works great!

AlexisWilke’s picture

Yes, I concur. t('Search and advertising') is better.

I would remove the capital on the A though because Drupal rules say so...

hass’s picture

Ok. I make it lowercase. I may flip the words... Advertising and search

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

John Franklin’s picture

Version: 7.x-1.x-dev » 6.x-3.5
Status: Closed (fixed) » Needs review
FileSize
5.27 KB

A backport of #25 to 6.x. (against 6.x-3.5.)

hass’s picture

Version: 6.x-3.5 » 6.x-3.x-dev

This needs to apply against DEV

hass’s picture

rooby’s picture

Patch in #35 applies cleanly to 6.x-3.x-dev.

rooby’s picture

Also seems to work fine.

hass’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

exvita’s picture

FileSize
321.48 KB

Hi, I was trying to add a REMARKETING TAG of google analytics.
I guess this is the one that can solve that problem?
I update it with "google_analytics-1.x-doubleclick-7.x.patch"
But I get attached warning, it's not successful.
Could you please advise if I did it right, and if not, how to do it?
Thanks.

Warning

FiNeX’s picture

Would be possible to have this patch applied on 7.x too?
I'm sorry, I didn't see the option already available on Google Analytics settings.

  • Commit f773f0b on 6.x-4.x by hass:
    Issue #1741514 by John Franklin: Use the doubleclick.net URL instead of...