The ROI Revolution Blog

Copy Profiles in Google Analytics

August 6, 2009

copy_profile.gifI've written a Greasemonkey script that allows you to copy and paste profile settings from one profile to another. This includes main website profile information, goals, filters, and users. Hopefully this will save you some time in situations where you need to create multiple profiles that share a lot of the same attributes.

The best way to understand exactly what this script does is to download it and try it out:

  1. Get Firefox
  2. Get Greasemonkey
  3. Get the Copy Profiles script

The profiles have to be in the same account, but hopefully that won't be too limiting to anyone. I actually spent a significant amount of time getting this to work across accounts, but decided that wouldn't be the best for several reasons:
  • The main profile settings are rarely the same for profiles across accounts.
  • The goals are rarely the same for profiles across account. If you want to copy goals across accounts, I would recommend getting Lunametrics' Goal Copy add-on.
  • Some filters may be the same across accounts, but there's a danger of accidentally copying filters that reveal too much about a particular account if you simply copy all filters from one profile to the other.
  • Ditto for users.

If you think I'm wrong and you'd really like to be able to copy profiles across accounts, let me know why and I'll see what I can do. Or if you're into writing Greasemonkey scripts, you could always write the script yourself. I'd be very interested to see it when you get done.

I purposefully wrote this script so that it wouldn't break in the way that these types of scripts would normally break. It's possible it could break in other ways, so let me know if you see any issues.

You should have no problems using this alongside the GARE. It will most likely be included at some point depending on the response I get.

I have one additional script idea that I may release today, tomorrow, later, or not at all. It might be easier to guess this one.

Google Analytics for Online Advertisers
Here at ROI Revolution, we consider Google Analytics tracking essential for paid search, so it's included in our PPC Campaign Management service.

Comments

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You have to create the profile first. Then you copy the old profile and paste it to the one you just created. I don't know of any particular reason why it wouldn't work in Firefox 4, but it's possible that a Google Analytics update caused it to not work in general.

April 1, 2011 7:07 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: You can edit the script the same way that you can any other Greasmonkey script. It's probably not too hard to separate Profile copy from filter only copy, but goal copy is just a portion of the profile copy, so that will likely be harder to peal out. You're probably better off using another tool for goal copying like the Lunametrics Goal Copy Firefox Extension. It may only work for FF 3.5, but you can try updating the extension yourself.

April 1, 2011 7:15 AM

Simon Whatley said:

@Jeremy: thanks. I saw your reply to a previous commenter about the profile copying, so got it to work. Do you know of any script that simply duplicates the main profile detail without the goals, filters and users? I don't really want to delve into your code right now. :-)
The Lunametrics extension is very useful, although I haven't tried to install it on FF4 yet. Thanks for your help.

April 1, 2011 9:54 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Simon: As far as I know, mine is the only script that duplicates main profiles details at all. It would probably be a nice enhancement to have the option to select exactly what you want to duplicate. I'll consider that for a future update.

April 1, 2011 10:22 AM

Sam Garret said:

Hmm. Using FF3.6, win7 and v0.2.8 I'm not having any luck. The copy and paste links appear. Clicking on 'copy' bolds the copy link immediately. Then clicking 'paste' on a new profile opens up the 'edit profile' profile page and everything stops. Turning on console.logging reveals the stage number never goes past 0, and the last getValue is for filter_number.

Any suggestions? TIA

May 19, 2011 12:05 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Sam: The quickest fix would probably be to upgrade to FF 4. I fixed some issues in the script recently which I thought were related to a GM updated, but from what you're saying, it sounds like they were FF 4 only issues that are now breaking it for FF3.

May 19, 2011 7:19 AM

Sam Garret said:

Just reporting to say FF 4 did indeed do the trick when I tried it on my home system. Much obliged :-)

May 22, 2011 7:00 PM

Rich hoeg said:

Have you tried to make this script work with Google Analytics version 5?

June 21, 2011 7:45 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Rich: Not yet. I'm trying to avoid having to support two versions of the script, so I'm holding off on updating it for now.

June 21, 2011 8:28 AM

Kalpesh said:

Hi, this script wouldn't copy report settings would it?

When I export a report to PDF, it shows me some data and graphs. But I have added a few extra bits and pieces to it.

So, would this script copy the modifications I made to that report and apply it to another account/profile? Thanks

February 1, 2012 9:22 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Kalpesh: Unfortunately it won't. This script just lets you copy the main settings, goals, filters and users from one profile to another.

February 6, 2012 2:52 PM

Dave Harper said:

Hey Jeremy. Thanks for the script. I wonder if you ever plan to update it for the new interface, since we can no longer revert to the old interface for admin operations.

June 26, 2012 10:32 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Dave: There are currently no plans to update this script for the new interface.

June 26, 2012 10:46 AM

Mehdi said:

Finally someone did it!

Thank you so much Jeremy.

You are my hero :)

August 6, 2009 12:32 PM

Jonathan said:

Awesome.

One tiny quibble, in that I don't get any confirmation when I copy a profile that it's been copied.

August 6, 2009 4:45 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Jonathan: You're right. I haven't thought of a good way to handle that yet. I could pop an alert box or something. I suppose alternatively I could just have a single column and change all the "Copy" links to "Paste" links. Any preference?

August 6, 2009 4:55 PM

Niamh Phelan said:

Hi Jeremy

Hats off, legend, you have made me more much needed time.

Many thanks
Niamh

August 7, 2009 5:02 AM

Tim Leighton-Boyce said:

This has brought a big smile to my face. Thank you very much for making this.

August 7, 2009 5:07 AM

Julien Coquet said:

Hi Jeremy,

great work as usual!

I took the liberty of translating your post to French and provide a French version of the plug-in.

The French post is at
http://bit.ly/78ntm

See you in Mountain View (fingers crossed)

Cheers,

Julien Coquet

August 7, 2009 7:48 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Julien: Thanks for doing the translation. I can't help but think that the script looks way cooler in French.

If anyone else want to do a translation of the post and script into their native language, feel free! Just link back to this post and leave a comment so I can admire how nice the script looks in your language.

August 7, 2009 8:03 AM

Steven Morgan said:

Hi there - fantastic resource thank you.

I'd like to put in a vote for an option to transfer profiles across multiple accounts.

Working in house on numerous diverse sites means that I'm frequently transfering settings across accounts - and its a very frustrating process!

August 9, 2009 2:38 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Steven: I've updated the script to allow for copying profiles from one Google Analytics account to another. That along with Lunametrics' Goal Copy Add-on should give you a faster way to transfer most settings.

I will keep your vote in mind when working on future updates of the script.

August 10, 2009 7:47 AM

Adam Green said:

Yes! I wanted to figure a way to do this myself (the copy and paste)... kudos to you guys and thanks for sharing with the community.

August 18, 2009 3:03 PM

Brian said:

Hi, I've just come across this posting which I think is going to save me a lot of time.

However, although I see the copy and paste functions, when using them I don't get a new profile entry despite it appearing to copy the all the profile elements.

Can you do a dummies instruction guide to make so I'm using your script correctly please?

Thanks in advance.

August 30, 2009 5:34 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Brian: Here are the instructions:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

Basically, it's up to you to create the profile that you'll be "pasting" the settings to. The script doesn't create any profiles for you. All it does it copy all profile settings from one profile to another. This includes the main profile configuration, goals, filters, and user settings.

August 31, 2009 7:58 AM

James Dutton said:

Hi Jeremy,

Great work on this script, what an amazing timesaver! Really appreciate you sharing your hard work with the community - kudos!

Cheers, James.

September 6, 2009 10:07 PM

Brian Katz said:

Hi Jeremy

Amazing work - what a time-saver.

Respect
Brian

November 9, 2009 3:03 AM

Ryan said:

This script has saved me hours. Thank you so much.

Now that GA has expanded the Goals to 20, the script unfortunately does not work anymore, any chance of an update?

November 18, 2009 6:00 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Ryan: Yes, it should be updated. If it doesn't seem to be working, try clearing your cache. You can also edit the script and see if you're using 0.2.5.

November 19, 2009 7:24 AM

Eric said:

Thanks for the tool. I tried using it on my account and it failed on pasteGoal. I tracked it down to not firing the onclick event when selecting the goal type. I've tweaked the script a bit to instead of call:


inputTags[i].checked = GM_getValue("input" + i);


for checkboxes and radio buttons, to instead use a simulated click event (thanks http://wiki.greasespot.net/Location_hack ) with:


var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, true); inputTags[i].dispatchEvent(evt);


A full script diff is here:


--- Downloads/copy_profiles.user.js 2009-11-24 11:13:23.778070954 -0800
+++ /home/ewebb/.mozilla/firefox/dwv8hyta.default/gm_scripts/copy_profiles/copy_profiles.user.js 2009-11-24 11:15:17.571411379 -0800
@@ -172,7 +172,11 @@
inputTags = goals.getElementsByTagName("input");
for (i = 0; i if (inputTags[i].type == "radio" || inputTags.type == "checkbox") {
- inputTags[i].checked = GM_getValue("input" + i);
+ if(GM_getValue("input" + i)) {
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent("click", true, true);
+ inputTags[i].dispatchEvent(evt);
+ }
} else {
inputTags[i].value = GM_getValue("input" + i);
}
@@ -410,4 +414,4 @@
copyFilters();
} else {
mainCode();
-}
\ No newline at end of file
+}


I might make other tweaks, I'll post them if you say they are valuable. Specifically, I am not sure if this script copies the ordering of filters in use (which are important for advanced filters).

cheers,
eric

November 24, 2009 2:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: The latest version of the script already uses simulated click events rather than setting checked to true. This can actually be done just by replacing:

inputTags[i].checked = GM_getValue("input" + i);

with the following:

if (GM_getValue("input" + i)) {
inputTags[i].click();
}

You may need to clear your cache to get that version of the script. The script should already be capturing filter order as well, but feel free to post tweaks or additional suggestions.

November 24, 2009 2:57 PM

Eric said:

@Jeremy

Thanks for the quick response. I've been working through a couple other bugs in the script before i saw your response!

Can you check your server? I don't think it serving the latest version. In the old posts, i see references to 0.2.5 but the file i keep getting from the server says it is version 0.2.4, and i don't see the simulated click behavior you've mentioned.


$ curl http://roirevolution.com/script/copy_profiles.user.js
// ==UserScript==
// @name Copy Profiles
// @namespace roirevolution.com
// @description Copy the settings from one profile to another profile
// @include http://www.google.com/analytics/settings/*
// @include https://www.google.com/analytics/settings/*
// @include https://adwords.google.com/analytics/settings/*
// ==/UserScript==

// Version 0.2.4


is the URL http://roirevolution.com/script/copy_profiles.user.js correct? That is the one linked to on http://www.roirevolution.com/blog/2009/08/copy_profiles_in_google_analytics.html and http://www.roirevolution.com/blog/2009/08/copy_filters_in_google_analytics.html

November 24, 2009 7:35 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: 0.2.5 should be uploaded now. Thanks for letting me know! This version also includes a slight change that makes the "copy" button for a profile turn bold after you click it.

November 25, 2009 7:26 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric: You can also let me know if you find any bugs or if you have any feature requests. Usually if there's a bug in one of my scripts, it's there because I don't know yet that it's there. Once I know it's there, I can usually fix it without too much trouble. If I'm not able to fix it, I will respond to a comment with something like, "yeah, it looks like I'm not going to be able to do that" and then maybe I'll sunset it if it was a previously working feature or something like that. You can certainly work out the solutions to the bugs on your own if you enjoy the exercise; I'd just like to know about the bugs so I can fix them ASAP.

November 25, 2009 2:49 PM

Eric said:

@Jeremy

You are going to hate me for finding your script and commenting on it so much!

I've not tested 0.2.5, since I finally got my version of 0.2.4 working enough.

My version is probably worth contributing back to you, but the code isn't really clean and it might have a bias to my use cases.

That said, there was a bug in 0.2.4 (that still is in 0.2.5) that essentially keeps checkbox values from being copied from one goal page to another.

For the most part, things worked very well for me and I really appreciate the starting point!

The other tweaks I've made in my local copy of the script center around copying goals that have deep (more than 1 funnel step) in them. I was finding that the funnels were getting truncated in the destination goal.

cheers,
eric

November 25, 2009 4:31 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Eric:

Thanks for the bug fix. That's now included in 0.2.6. Also, thanks for pointing out the goal funnel truncating issue. Version 0.2.6 includes a fix for that as well. Let me know if you find anything else.

November 27, 2009 9:08 AM

Amit Ohayon said:

You're so the MAN...

Hour of work saved in a snap.

Dude, thanks!

:)

March 21, 2010 7:54 PM

Max said:

Does this script still work for everyone? I tried in several times today and it doesn't copy Ecommerce Settings, Goals, etc.

I followed the steps:

1. Create a new profile.
2. Click "Copy" next to the profile that has the settings you wish to copy.
3. Click "Paste" next to the profile you just created.

What am I doing wrong?

August 20, 2010 5:19 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Max: Yes, this feature of the script is broken. I'll see if there's any easy fix; this functionality can be a bit tricky to troubleshoot.

August 20, 2010 7:37 AM

Petr Weida said:

@Jeremy: the version from http://roirevolution.com/script/copy_profiles.user.js still stops copying at first goal. Do you know the solution? Thank you very much for support.

August 24, 2010 4:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Petr: Edit the script and make sure that you are getting version 0.2.7. If you're not, you may need to clear your cache, close and reopen your browser, and try downloading the script again.

August 24, 2010 7:38 AM

Petr Weida said:

@Jeremy Thanks, now it is working :-)

August 24, 2010 9:13 AM

Robert Austin said:

Just wanted to say great job and thanks for this great script. worked perfectly first time and will no doubt become a permenant tool in my bag of analytics tricks.

January 5, 2011 2:06 AM

Adam said:

The script does not download. The link takes me to the code. Suggestions to install?

January 21, 2011 11:08 AM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Adam: Try it again. It should work now.

January 21, 2011 11:31 AM

@RachaelGerson said:

Jeremy, you just made my day! I searched for you on Twitter so I could thank you and share this post, no luck though. Thanks again for this great tool!

February 7, 2011 5:56 PM

Simon Whatley said:

Jeremy. I'm running Firefox 4. When trying to copy profiles in GA, nothing happens. It cycles through all the screens (profile and goals etc), but when finished, the copied profile doesn't appear. Can you tell me what might be wrong? Thanks.

March 31, 2011 4:53 PM

Simon Whatley said:

Jeremy, could you tell me how I could separate the profile copy, filter copy and goal copy, into separate scripts? As I mentioned in my previous comment. The filter copying works well, but profile and goal copying don't, somewhat unfortunately. Thanks.

March 31, 2011 5:09 PM