How Do I Get GCLID To Store And Use For Offline Conversion FOR WIX

I tried and it is not working, is it the coding may be different? Please check the codes below

I added this code to the as google suggested.

I put the id same as the var gclidFormFields = [‘GAtracker’]; in the script

I tried with a ?gclid=123123123 value and it is not parsed to the input

The database and forms work just fine, but there is nothing in gclid

PLEASE HELP!
I really need the id for conversion tracking.

This forum is dedicated to Corvid and and can’t provide support for HTML scripts. You should refer to the following for more information regarding your script:

I won’t close this thread, since maybe some other users have some experience with this and could contribute some ideas. You should go to the Google Analytics Community . You can also contact the Wix support team and they might be able to provide direction.

I get what Yisrael is saying, however, this is still a Corvid issue with a Corvidable solution.

Since you’re storing the glcid to the Wix Database (Content Manager), your best bet may to actually go through the Wix Corvid APIs rather than trying to hack it via the Tracking and Analytics section (which I’ve also been doing for over a year now :laughing:).

From my experience, Wix stores a virtual query parameters object separate from the actual DOM Location url. When I used to try to access the query, I think I used to have issues.

If I understand you correctly, the query object from the wix-location library allows you to get the gclid from the URL. You can access it like this from your Page/Site code.

import wixLocation from 'wix-location';
import wixData from 'wix-data';

let userGCLID; //The global variable for this user's session.
$w.onReady(function(){
    //Get the query Params from the current URL.
    userGCLID = wixLocation.query['gclid'];
});

//The handler for the submission.
export function submitToDatabase(){
    wixData.insert("GCLIDDatabase",{"firstName":"Bob", "gclid":userGCLID})
}

I have contected wis support team…replied with reference and I need to go figure out myself. Seriously…this customer service is crap.

THANK YOU VERY MUCH!!! Finally some help and not telling me to go figure…

Nice. To be honest, I really wasn’t sure what he was trying to do. I saw the database, but the code was really not Corvid. It’s nice having a community to turn to.

Thank you very much for replying with an attached code. btw, I have searched to the corners of Google that there is no tutorial on this topic. Maybe I missed out, but hopefully, anyone also looking for this will get some help.

I figured out myself before reading this reply. I am super new to this and have never coded in this language. I only know HTML and javascript. For other platforms, I can easily find Google to give me answers for familiar coding language for coding problems. But I really cannot find enough help from Wix coding on the net.

I’m not sure if these are correct. please guide me on the way. If anyone is doing this please do not use any JS code from google for head / body

PAGE CODE

import wixLocation from 'wix-location';
import {session} from 'wix-storage';
let valuebe; // "value"
let urlpara;

$w.onReady(function () {
$w("#dataset1").onAfterSave((sendFormData)); //for implementing sendGrid
console.log(wixLocation.query); // start glclid store and get
valuebe = session.getItem("gclidvar");
urlpara = wixLocation.query["gclid"];

$w("#GAtracker").value = valuebe;
if (urlpara !== undefined) {
session.setItem("gclidvar", wixLocation.query["gclid"]);
}
});

SITE CODE

// For full API documentation, including code examples, visit https://wix.to/94BuAAs
import {session} from 'wix-storage';
import wixLocation from 'wix-location';
let valuebe;
let urlpara;
$w.onReady(function () {
valuebe = session.getItem("gclidvar");
urlpara = wixLocation.query["gclid"];
if (urlpara !== undefined) {
session.setItem("gclidvar", wixLocation.query["gclid"]);
}
});

These codes worked as follows

  1. user came in from google ad, therefore given ‘gclid’ as an id to identify.
  2. Id stored
  3. user browse around and finally went to form page and fill in forms
  4. Id get and submitted to form.
  5. Id stored in the Wix dataset for later google offline conversion use.

Questions

  1. Does Christopher Derrell method stores ‘gclid’ right from the start? Because from what I experienced and tested. The ‘gclid’ from “www.test.com?gclid=123123123” is GONE after the user browses around. That is why Google suggests storing it when it is detected for later use with their JS script code.

  2. Google analytics have a ‘clientId’ for offline conversions that work the same way but not for Google ads. How can I get the clientId for this? I tried How to track CRM Offline Conversions in Google Analytics (Part 2) - YouTube and it doesn’t work with Wix coding. returned ‘false’. I tried tons of other tutorials and searched corners and found nothing covering this with Wix.

The main problem is where can I find the name elements/id from HTML from Wix? E.g.

If someone can help me to get these input elements I believe things will be solved.
Please help if anyone know.

Just to add to Yisrael’s comments above, your post is asking for help about using the Google Click Identifier which is part of Google and not part of Wix, therefore that is why you were told that it was not able to provide support for you as you are using third party provided script.

As mentioned clearly on Wix pages here.
Important:
We cannot provide support for external codes that were not created or tested with Wix. If you are experiencing an issue with your code snippet, please contact the provider directly.
https://support.wix.com/en/article/using-iframes-to-display-visible-content-on-your-site
Important:
Wix does not provide support for technical difficulties associated with third-party code snippets. If you are experiencing an issue with your code snippet, please contact the provider directly.
https://support.wix.com/en/article/embedding-custom-code-to-your-site

The same as was mentioned in a previous forum post reply about the same thing.
https://www.wix.com/corvid/forum/community-discussion/adwords-gclid-tracking

Nobody is telling you to go figure as you put it, Wix Support will tell you to go here as they don’t deal with anything that is code related. However, the Wix Corvid Forum is only for Wix related code issues and not for providing help with third parties code, which for help with that you should really be contacting the third party themselves and asking their own support.

As for your question, can we assume that you have done everything as stated in the Google instructions for gclid as shown here for your Google Ads account.
https://support.google.com/google-ads/answer/7012522?hl=en

Or as mentioned on the page, you can use Google Tag Manager to collect the gclid, as mentioned on the same page.

Wix already provide support for Google Tag Manager.
https://support.wix.com/en/marketing-tools-analytics/marketing-integrations-tracking

Tip: Use Google Tag Manager to collect the GCLID
If you have a Google Tag Manager account and use the same field name across all forms, you can use it to implement the above script by following these steps:

  1. Log into your Google Tag Manager account at http://www.google.com/tagmanager .

  2. Under “Accounts,” click the name of the account with the container you use for your Google Ads tags.

  3. Under “Containers,” click the name of the container you want to use.

  4. Click the New button, then select Tag from the drop-down menu.

  5. Enter a name in the “Tag Name” field (you might want to use something like “Google Ads Click ID Collection for Conversion Import”).

  6. Under “Tag Type,” select Custom HTML Tag from the drop-down menu.

  7. Copy the JavaScript from step 2 above and paste it into the “HTML” field.

  8. Under “Firing Rules,” click the +Add button. Check the box next to “All pages” and click Save .

  9. Click Save .

  10. Click the Create Version button.

  11. Click the Publish button.

Anyways, thankfully Christopher has provided you with a solution above for using it within Wix and I have found this page helpful too when using it myself, although that was not with a Wix website.
https://www.wordstream.com/gclid

Finally, if you want to have them put a parameter in the url of your website, then you can use Wix-Router for that.
https://www.wix.com/code/reference/wix-router.html#customizeQuery

Hi. How do i test this to see if it works?