The ROI Revolution Blog

August 6, 2009

I’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:

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.

@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?

@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.

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.

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:

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.

@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.

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.

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.

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.

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.

@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.

@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.

@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.

@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.

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.

@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.