The Canadians used a variety of methods: acoustic ranging, flash spotting, and aerial observation (including photography).
Flash spotting works by spotting the reflection of the muzzle flash against the sky when the gun is fired. The spotters report the direction in which they saw the flash, and triangulation is used to determine the position of the guns from the reports of multiple spotter. Since the reflection of the muzzle flash against the sky is spread out, the direction can't be determined with great accuracy, so it isn't a very accurate method (but is better than nothing). Another disadvantage is that it only works at night. An advantage is that it requires only very simple equipment. Flash spotting was the 3rd most important method used by the British during WW1.
Acoustic ranging is probably what was referred to by "some sort of electronic detection device" (strictly speaking, it's "electrical" rather than "electronic"). The version used by the Canadians is the system developed by the British in 1916, by a team headed by William Lawrence Bragg (who won, with his father, the 1916 Nobel Prize in Physics for his pre-war contributions to crystallography (X-ray diffraction)). A line of microphones was placed a few kilometres behind the front line (so about 10km from the artillery positions); the microphone array was about 10km long. Signals from the microphones would be optically recording on movie film, and the difference in position along the film of the signals from the different microphones gives the difference in arrival times of the sound of the gun at the microphones. From this, the position of the guns can be determined, to better than 50m, which is sufficient accuracy for counter-battery fire. The low-frequency microphones using heated platinum wires developed by Bragg's team were an important part of the system (the use of movie film for recording the signals was adopted from the French system). By the end of the war, this system could deliver a location for a firing gun within minutes (the film could be developed in under 1 minute). This British system was used by the Dominions on the Western Front (including the Canadians), and was also adopted by the USA in 1917. Acoustic ranging was the 2nd most important method used by the British during WW1. It's still used today, in modern systems taking advantage of modern electronics and computers.
Aerial observation is straightforward in principle: fly over the enemy artillery positions and spot the gun positions. In practice, the interpretation of aerial photographs takes skill, and spotting camouflaged gun positions is easier said than done. The main disadvantage of aerial observation is the time lag between observation and getting the information to where it is needed, especially when photography is used. However, unlike flash spotting and acoustic ranging, it can detect artillery even if it isn't fired. This was the most important British method of the war.
The Canadians, courtesy of Major Andrew McNaughton, pre-war engineer and artillery officer, established a very effective system to integrate these 3 sources of information and direct counter-battery fire. Bragg's team worked with the Canadians to help them use their acoustic ranging system. Thanks to the work of the Canadian CBSO (Counter Battery Staff Office, set up and led by McNaughton), counter-battery fire at Vimy Ridge was very successful. Bragg's system scored an impressive success with the detection of a heavy piece 11 miles behind the front lines - this was about twice as far as the usual range for accurate detection, but 3 microphone arrays were used together to obtain an accurate location at that distance.