Crazy Egg now provides different code than what is provided in this module. Because of the change, the successful installation of the tracking script cannot be detected by the tool in the Crazy Egg dashboard. Current code looks like this (where the 00000000 is your account number):

<script type="text/javascript">
setTimeout(function(){var a=document.createElement("script");
var b=document.getElementsByTagName("script")[0];
a.src=document.location.protocol+"//script.crazyegg.com/pages/scripts/0000/0000.js?"+Math.floor(new Date().getTime()/3600000);
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
</script>

Working on a patch.

Comments

jenna.tollerson’s picture

StatusFileSize
new512 bytes

Patch

jenna.tollerson’s picture

Status: Active » Postponed

Now getting feedback from Crazy Egg support that the original code should be working; may have jumped the gun on this.

hkorik’s picture

It looks like the Crazy Egg script update does need to be used
in order not to receive this error when adding a new screenshot to a page on your site.

I have confirmed this with Crazy Egg customer support,
and tested that this patch update fixes the error with my testing environment.

jenna.tollerson’s picture

Status: Postponed » Active

Alrighty then switching back to active

michelle’s picture

Just noting that this updated script was incorporated into the D8 branch already.

Anonymous’s picture

The script seems to need another update; CrazyEgg tells me that although the script will work, it is out of date, and offers this script instead:

<script type="text/javascript">
setTimeout(function(){var a=document.createElement("script");
var b=document.getElementsByTagName("script")[0];
a.src=document.location.protocol+"//script.crazyegg.com/pages/scripts/[FIRST_FOUR_OF_ID]/[LAST_FOUR_OF_ID].js?"+Math.floor(new Date().getTime()/3600000);
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
</script>

I guess they decided to start using script.crazyegg.com instead of cloudfront.net.

damienmckenna’s picture

Status: Active » Reviewed & tested by the community

I don't see any difference between the code in the patch and what's in #6.

damienmckenna’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.59 KB

So the JS wasn't working, so I reworked the output so it manually inserted the JS rather than using drupal_add_js().

damienmckenna’s picture

StatusFileSize
new2.61 KB

An alternative approach, this adds an option to control whether the JS is added to the header or footer.

damienmckenna’s picture

StatusFileSize
new2.61 KB

Oh, there was a question mark missing in the URL so the timestamp was being appended right after the ".js", i.e. as part of the path, instead of as a query string.

phire’s picture

StatusFileSize
new2.1 KB

Patch #10 had some whitespace and formatting issues that didn't apply cleanly. This just fixes that - otherwise everything is the same. Tested against 7.x-1.x

chroid’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm that the patch in #11 both functions correctly (with regards to adding the header/footer options) AND corrects the message in the Crazy Egg dashboard/snapshot relating to out of date inclusion script.

Not much movement on this in a while - are we likely to see it committed through?

michelle’s picture

I'm going to try and take some time to get a full release out for the D8 branch, which is what I signed on for. Since the original maintainer doesn't seem to be active on here, I'll have a look at the D7 branch as well. I don't want to commit to any ETA because that never seems to work out but it looks like I'll have some extra internal time in the near future so hopefully soon.

  • Michelle committed 672892f on 7.x-1.x authored by phire
    Issue #2403503 by DamienMcKenna, jenna.tollerson, phire: Crazy Egg...
michelle’s picture

Status: Reviewed & tested by the community » Fixed

I tried out the patch and see the additional options and the script is still being added so I went ahead and committed it. However, I do not have a CrazyEgg account so I have no way to test that this is working for real. It would be great if someone could test the dev snapshot when it is released to be sure everything is still working correctly. If there are any problems, please let me know.

Status: Fixed » Closed (fixed)

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

shiraz dindar’s picture

Hi @Michelle,

I see that you committed the fix to dev, but the dev release for this module is not published (so you can't see it on the module page, nor can you download it with drush --select). I grabbed the dev release with a direct git clone of the module, but you probably want to publish it too.

Cheers and thanks
Shiraz

thomasmurphy’s picture

It would be great to get this into the main release module.

michelle’s picture

Sorry, this fell off my radar. There hasn't been anything new reported in a while so I'll look into making a new release, hopefully sometime this week.